Skip to content

Commit

Permalink
Tweaked remaining specs for lazy dep loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoskings committed Mar 20, 2011
1 parent d32cce0 commit e1e99e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 6 additions & 0 deletions spec/babushka/dep_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions spec/babushka/source_pool_spec.rb
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions spec/babushka/source_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit e1e99e2

Please sign in to comment.