test/loader_test.rb in boson-0.2.0 vs test/loader_test.rb in boson-0.2.1
- old
+ new
@@ -33,10 +33,15 @@
load :blah, :file_string=>"module Blah; #from file\ndef bling; end; end"
library('blah').command_object('bling').description.should == 'already'
end
end
+ test "from inspector attribute config sets command's config" do
+ load :blah, :file_string=>"module Blah; config :alias=>'ok'\n; def bling; end; end"
+ library('blah').command_object('bling').alias.should == 'ok'
+ end
+
test "hash from inspector recursively merged with user's config" do
with_config(:libraries=>{'blah'=>{:commands=>{'blung'=>{:args=>[], :render_options=>{:sort=>'this'}}}}}) do
CommentInspector.expects(:scrape).returns({:render_options=>{:fields=>['this']}})
load :blah, :file_string=>"module Blah; def blung; end; end"
library('blah').command_object('blung').render_options.should == {:fields=>["this"], :sort=>"this"}
@@ -223,22 +228,9 @@
with_config(:libraries=>{'bleng'=>{:namespace=>true}}) do
capture_stderr {
load 'bleng', :file_string=>"module Bleng; def bling; end; end"
}.should =~ /conflict.*bleng/
end
- end
- end
-
- context "reload" do
- before(:each) { reset }
- test "loads currently unloaded library" do
- create_library('blah')
- Manager.expects(:load).with('blah', anything)
- Manager.reload('blah')
- end
-
- test "doesn't load nonexistent library" do
- capture_stdout { Manager.reload('bling', :verbose=>true) }.should =~ /bling doesn't/
end
end
end
end