Warning, file /education/kturtle/spec/number_spec.rb was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 # SPDX-FileCopyrightText: 2009 Cies Breijs 0002 # 0003 # SPDX-License-Identifier: GPL-2.0-or-later 0004 0005 require File.dirname(__FILE__) + '/spec_helper.rb' 0006 $i = Interpreter.instance 0007 0008 describe "number" do 0009 it "should accept negative numbers" do 0010 $i.should_run_clean <<-EOS 0011 $x = -1 0012 $x = -1000 0013 EOS 0014 end 0015 0016 it "should accept numbers with a decimal point" do 0017 $i.should_run_clean <<-EOS 0018 $x = 1.23 0019 $x = -1.23 0020 EOS 0021 end 0022 0023 it "should automatically remove floating point" do 0024 $i.should_run_clean <<-EOS 0025 assert 1.00000 == 1 0026 assert -123.0 == -123 0027 EOS 0028 end 0029 end