spec/musterb/evaluator_spec.rb in musterb-0.1.2 vs spec/musterb/evaluator_spec.rb in musterb-0.2.0
- old
+ new
@@ -1,9 +1,9 @@
describe Musterb::Evaluator do
it "can pull local variables out from the binding" do
foo = "bar"
- evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding)
+ evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding, nil)
evaluator["foo"].should eq "bar"
end
it "pulls out values from ." do
evaluator = Musterb::Evaluator.new Musterb::ObjectExtractor.new(2, nil)
@@ -70,26 +70,26 @@
end
context "switching context" do
it "switches inside a hash" do
hash = { "foo" => "bar"}
- evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding)
+ evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding, nil)
evaluator.block_if hash do
evaluator['foo'].should eq 'bar'
end
end
it "resets the context later" do
hash = { "foo" => "bar"}
- evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding)
+ evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding, nil)
evaluator.block_if(hash) {}
evaluator["hash"].should eq hash
end
it "cascades the context to the parent" do
foo = "bar"
hash = { }
- evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding)
+ evaluator = Musterb::Evaluator.new Musterb::BindingExtractor.new(binding, nil)
evaluator.block_if hash do
evaluator['foo'].should eq 'bar'
end
end
end
\ No newline at end of file