diff --git a/spec/babushka/dep_spec.rb b/spec/babushka/dep_spec.rb index e9c352678..78a1f6687 100644 --- a/spec/babushka/dep_spec.rb +++ b/spec/babushka/dep_spec.rb @@ -248,6 +248,9 @@ end.dep_defined?.should == true end context "lazily" do + before { + Base.sources.stub!(:current_real_load_source).and_return(Base.sources.anonymous) + } it "should not define the dep when called without a block" do dep('lazy defining test').dep_defined?.should == nil end @@ -280,6 +283,9 @@ end.dep_defined?.should == false end context "lazily" do + before { + Base.sources.stub!(:current_real_load_source).and_return(Base.sources.anonymous) + } it "should not be defined, and then have failed defining after a run" do dep('lazy defining test with errors') do nonexistent_method diff --git a/spec/babushka/source_pool_spec.rb b/spec/babushka/source_pool_spec.rb index 4d10306c6..6444bce48 100644 --- a/spec/babushka/source_pool_spec.rb +++ b/spec/babushka/source_pool_spec.rb @@ -172,10 +172,6 @@ end } it "should use the template" do - the_dep.template.should be_nil - # This triggers dep.define!, but the load_context is gone. - # That's what we're testing. - the_dep.met? the_dep.template.should == template end after { @@ -219,8 +215,8 @@ end it "should not find a template in the wrong source, and raise" do L{ - mock_dep('template selection 4', :template => 'meta_3', :in => @source1) - }.should raise_error(DepError, "There is no template named 'meta_3' to define 'template selection 4' against.") + mock_dep('template selection 4', :template => 'meta_3', :in => @source1).template + }.should raise_error(DepError, "There is no template named 'meta_3' to define 'template selection 4' against.") end end context "with suffixes" do diff --git a/spec/babushka/source_spec.rb b/spec/babushka/source_spec.rb index 7659e7414..edc0bd9ae 100644 --- a/spec/babushka/source_spec.rb +++ b/spec/babushka/source_spec.rb @@ -95,8 +95,6 @@ it "should not have defined the deps" do dep = @source.deps.for('test dep 1') dep.dep_defined?.should be_false - dep.template.should be_nil - dep.context.should be_nil end it "should store the source the dep was loaded from" do @source.deps.for('test dep 1').dep_source.should == @source