Commit 601e986

mo khan <mo@mokhan.ca>
2013-05-18 01:57:46
add IOC spec
1 parent defedb9
Changed files (1)
spec
spec/unit/ioc_spec.rb
@@ -0,0 +1,19 @@
+require "spec_helper"
+
+describe Spank::IOC do
+  context "when bound to a container" do
+    let(:container) { fake }
+    let(:component) { fake }
+
+    before :each do
+      container.stub(:resolve).with(:idbconnection).and_return(component)
+      Spank::IOC.bind_to(container)
+    end
+
+    let(:result) { Spank::IOC.resolve(:idbconnection) }
+
+    it "should resove items from that container" do
+      result.should == component
+    end
+  end
+end