Permalink
Browse files

Tasks with arguments: Refactoring to remove duplication in test

  • Loading branch information...
1 parent 946919c commit 8bd5f5eaa671e79ee0958a7e0b06239868f2f238 @antonymarcano antonymarcano committed Jul 2, 2011
Showing with 8 additions and 10 deletions.
  1. +8 −10 spec/cukesalad/specifics_spec.rb
View
18 spec/cukesalad/specifics_spec.rb
@@ -7,18 +7,16 @@ class NeedingSpecifics
module CukeSalad
describe Specifics do
- it "has an item of specific information" do
- something = NeedingSpecifics.new
- something.understand_the "specific 'information'"
- something.value_of(:specific).should == "information"
+ [ "specific 'information'",
+ 'specific "information"'
+ ].each do | specifics |
+ it "can find #{specifics}" do
+ something = NeedingSpecifics.new
+ something.understand_the specifics
+ something.value_of(:specific).should == "information"
+ end
end
- it "has an item of specific information" do
- something = NeedingSpecifics.new
- something.understand_the 'specific "information"'
- something.value_of(:specific).should == "information"
- end
-
it "has items of specific information" do
something = NeedingSpecifics.new
something.understand_the "first 'item' second 'another'"

0 comments on commit 8bd5f5e

Please sign in to comment.