spec/command_spec.rb in scide-0.0.6 vs spec/command_spec.rb in scide-0.0.7
- old
+ new
@@ -31,21 +31,21 @@
@window.stub(:options){ @options }
end
it "should resolve command with a string" do
com = Scide::Command.resolve @window, 'SHOW fubar'
- com.should be_a_kind_of(Scide::Commands::Show)
+ com.should be_a(Scide::Commands::Show)
end
it "should use second part of string as contents when resolving a command with a string" do
com = Scide::Command.resolve @window, 'SHOW fubar'
com.text_with_options.should == 'fubar'
end
it "should resolve command with a hash" do
com = Scide::Command.resolve @window, :command => 'SHOW', :contents => 'fubar'
- com.should be_a_kind_of(Scide::Commands::Show)
+ com.should be_a(Scide::Commands::Show)
end
it "should give duplicated window options to the resolved string command" do
@window.should_receive :options
com = Scide::Command.resolve @window, 'SHOW fubar'
@@ -59,17 +59,16 @@
com.options.should == @options
com.options.should_not equal(@options)
end
it "should resolve camel-case command class names with a string" do
- puts Scide::Commands::FuBar
com = Scide::Command.resolve @window, 'FU_BAR'
- com.should be_a_kind_of(Scide::Commands::FuBar)
+ com.should be_a(Scide::Commands::FuBar)
end
it "should resolve camel-case command class names with a hash" do
com = Scide::Command.resolve @window, :command => 'FU_BAR'
- com.should be_a_kind_of(Scide::Commands::FuBar)
+ com.should be_a(Scide::Commands::FuBar)
end
it "should raise an error when type of contents is unknown" do
lambda{ Scide::Command.resolve(@window, []) }.should raise_error(ArgumentError)
end