spec/dependor/isolate_spec.rb in dependor-0.0.4 vs spec/dependor/isolate_spec.rb in dependor-0.0.5
- old
+ new
@@ -10,10 +10,14 @@
def subject
isolate(ExampleSubject)
end
+ def override
+ isolate(ExampleSubject, bar: "bar was overriden")
+ end
+
def foo
"the foo stub"
end
def bar
@@ -24,7 +28,14 @@
it "injects the subject's dependencies using methods on context" do
context = ExampleContext.new
context.subject.foo.should == "the foo stub"
context.subject.bar.should == "the bar stub"
+ end
+
+ it "allows overriding dependencies" do
+ context = ExampleContext.new
+
+ context.override.bar.should == "bar was overriden"
+ context.override.foo.should == "the foo stub"
end
end