Make only one assumption per context.

This commit is contained in:
Michael Kessler 2011-10-11 11:06:30 +02:00
parent 8891776e34
commit 8527cf40e3

View File

@ -70,7 +70,8 @@ describe Guard::Watcher do
end
end
context "with a watcher action without parameter for a watcher that matches file strings" do
context "with a watcher action without parameter" do
context "for a watcher that matches file strings" do
before(:all) do
@guard.watchers = [
described_class.new('spec_helper.rb', lambda { 'spec' }),
@ -107,7 +108,7 @@ describe Guard::Watcher do
end
end
context 'with a watcher action without parameter for a watcher that matches information objects' do
context 'for a watcher that matches information objects' do
before(:all) do
@guard_any_return.watchers = [
described_class.new('spec_helper.rb', lambda { 'spec' }),
@ -145,8 +146,10 @@ describe Guard::Watcher do
described_class.match_files(@guard_any_return, ['uptime.rb']).should == ['']
end
end
end
context "with a watcher action that takes a parameter for a watcher that matches file strings" do
context "with a watcher action that takes a parameter" do
context "for a watcher that matches file strings" do
before(:all) do
@guard.watchers = [
described_class.new(%r{lib/(.*)\.rb}, lambda { |m| "spec/#{m[1]}_spec.rb" }),
@ -183,7 +186,7 @@ describe Guard::Watcher do
end
end
context "with a watcher action that takes a parameter for a watcher that matches information objects" do
context "for a watcher that matches information objects" do
before(:all) do
@guard_any_return.watchers = [
described_class.new(%r{lib/(.*)\.rb}, lambda { |m| "spec/#{m[1]}_spec.rb" }),
@ -219,6 +222,7 @@ describe Guard::Watcher do
described_class.match_files(@guard_any_return, ['uptime.rb']).should == ['']
end
end
end
context "with an exception that is raised" do
before(:all) { @guard.watchers = [described_class.new('evil.rb', lambda { raise "EVIL" })] }