spec/builtins_spec.rb in rouge-lang-0.0.14 vs spec/builtins_spec.rb in rouge-lang-0.0.15
- old
+ new
@@ -218,23 +218,23 @@
end
describe "if" do
# TODO: refactor & break out individual assertions
it "should execute one branch or the other" do
- a = mock("a")
- b = mock("b")
+ a = double("a")
+ b = double("b")
a.should_receive(:call).with(any_args)
b.should_not_receive(:call).with(any_args)
subcontext = Rouge::Context.new context
subcontext.set_here :a, a
subcontext.set_here :b, b
subcontext.readeval('(if true (a) (b))')
end
# TODO: refactor & break out individual assertions
it "should not do anything in the case of a missing second branch" do
- a = mock("a")
+ a = double("a")
a.should_not_receive(:call)
subcontext = Rouge::Context.new context
subcontext.set_here :a, a
subcontext.readeval('(if false (a))')
end
@@ -257,10 +257,10 @@
it { subcontext.readeval('(do (x))').should eq 4 }
end
# TODO: refactor & break out individual assertions
it "should evaluate multiple arguments and return the last value" do
- a = mock("a")
+ a = double("a")
a.should_receive(:call)
subcontext = Rouge::Context.new context
subcontext.set_here :a, a
subcontext.set_here :b, lambda {7}
subcontext.readeval('(do (a) (b))').should eq 7