updated the watch spec to describe the tests better.

This commit is contained in:
Kevin Krauss 2011-10-07 10:45:26 -07:00
parent 33542acec9
commit a7b6ebeef1

View File

@ -128,16 +128,16 @@ describe Guard::Watcher do
described_class.match_files(@guard, ['spec_helper.rb', 'array.rb']).should == ['spec', ['foo', 'bar']] described_class.match_files(@guard, ['spec_helper.rb', 'array.rb']).should == ['spec', ['foo', 'bar']]
end end
it "returns nothing if the action returns something other than a string or an array of strings" do it "returns the evaluated addition argument in an array" do
described_class.match_files(@guard, ['addition.rb']).class.should == Array described_class.match_files(@guard, ['addition.rb']).class.should == Array
described_class.match_files(@guard, ['addition.rb'])[0].should == 2 described_class.match_files(@guard, ['addition.rb'])[0].should == 2
end end
it "returns nothing if the action response is empty" do it "returns nothing if the action response is empty string" do
described_class.match_files(@guard, ['blank.rb']).should == [''] described_class.match_files(@guard, ['blank.rb']).should == ['']
end end
it "returns nothing if the action returns nothing" do it "returns nothing if the action returns empty string" do
described_class.match_files(@guard, ['uptime.rb']).should == [''] described_class.match_files(@guard, ['uptime.rb']).should == ['']
end end
end end
@ -195,7 +195,7 @@ describe Guard::Watcher do
described_class.match_files(@guard, ['lib/my_wonderful_lib.rb']).should == ['spec/my_wonderful_lib_spec.rb'] described_class.match_files(@guard, ['lib/my_wonderful_lib.rb']).should == ['spec/my_wonderful_lib_spec.rb']
end end
it "returns multiple files specified within the action" do it "returns a hash specified within the action" do
described_class.match_files(@guard, ['hash.rb']).should == [{:foo => 'bar', :file_name => 'hash.rb'}] described_class.match_files(@guard, ['hash.rb']).should == [{:foo => 'bar', :file_name => 'hash.rb'}]
end end
@ -203,15 +203,15 @@ describe Guard::Watcher do
described_class.match_files(@guard, ['lib/my_wonderful_lib.rb', 'array.rb']).should == ['spec/my_wonderful_lib_spec.rb', ['foo', 'bar', "array.rb"]] described_class.match_files(@guard, ['lib/my_wonderful_lib.rb', 'array.rb']).should == ['spec/my_wonderful_lib_spec.rb', ['foo', 'bar', "array.rb"]]
end end
it "returns nothing if the action returns something other than a string or an array of strings" do it "returns the evaluated addition argument + the path" do
described_class.match_files(@guard, ['addition.rb']).should == ["2addition.rb"] described_class.match_files(@guard, ['addition.rb']).should == ["2addition.rb"]
end end
it "returns nothing if the action response is empty" do it "returns nothing if the action response is empty string" do
described_class.match_files(@guard, ['blank.rb']).should == [''] described_class.match_files(@guard, ['blank.rb']).should == ['']
end end
it "returns nothing if the action returns nothing" do it "returns nothing if the action returns empty string" do
described_class.match_files(@guard, ['uptime.rb']).should == [''] described_class.match_files(@guard, ['uptime.rb']).should == ['']
end end
end end