Warning, file /education/kturtle/spec/assert_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 "assert statement" do 0009 0010 it "should pass when evaluating true" do 0011 $i.should_run_clean 'assert true' 0012 end 0013 0014 it "should fail when evaluating false" do 0015 $i.run('assert false').errors?.should be_true 0016 end 0017 0018 it "should not take anything but a boolean argument" do 0019 $i.run('assert 123').errors?.should be_true 0020 $i.run('assert 1.23').errors?.should be_true 0021 $i.run('assert "qwe"').errors?.should be_true 0022 end 0023 0024 it "should take exactly one argument" do 0025 $i.run('assert').errors?.should be_true 0026 $i.run('assert true, true').errors?.should be_true 0027 end 0028 0029 end