Permalink
Browse files

Refactoring: Specifics spec behaviour summaries are more expresive

  • Loading branch information...
antonymarcano committed Jul 3, 2011
1 parent 0de053a commit 196d395bbbfcdc0daa146f94daa563d3ad8a4f64
Showing with 29 additions and 26 deletions.
  1. +29 −26 spec/cukesalad/specifics_spec.rb
@@ -7,35 +7,38 @@ class NeedingSpecifics
module CukeSalad
describe Specifics do
- [ "specific 'information'",
- 'specific "information"'
- ].each do | specifics |
- it "can find #{specifics}" do
+ context 'name value pairs' do
+
+ [ "specific 'information'",
+ 'specific "information"'
+ ].each do | specifics |
+ it "can be found in: #{specifics}" do
+ something = NeedingSpecifics.new
+ something.understand_the specifics
+ something.value_of(:specific).should == "information"
+ end
+ end
+
+ it "can have more than one name-value pair" do
something = NeedingSpecifics.new
- something.understand_the specifics
- something.value_of(:specific).should == "information"
+ something.understand_the "first 'item' second 'another'"
+ something.value_of(:first).should == "item"
+ something.value_of(:second).should == "another"
end
- end
-
- it "has items of specific information" do
- something = NeedingSpecifics.new
- something.understand_the "first 'item' second 'another'"
- something.value_of(:first).should == "item"
- something.value_of(:second).should == "another"
- end
- it "copes with names having more than one word" do
- something = NeedingSpecifics.new
- something.understand_the "first thing 'item' second thing 'another'"
- something.value_of(:first_thing).should == "item"
- something.value_of(:second_thing).should == "another"
- end
-
- it "should cope with values having more than one word" do
- something = NeedingSpecifics.new
- something.understand_the "first thing 'item' second thing 'another thing'"
- something.value_of(:first_thing).should == "item"
- something.value_of(:second_thing).should == "another thing"
+ it "can have more than one word as the name" do
+ something = NeedingSpecifics.new
+ something.understand_the "first thing 'item' second thing 'another'"
+ something.value_of(:first_thing).should == "item"
+ something.value_of(:second_thing).should == "another"
+ end
+
+ it "can have more than one word as the name or value" do
+ something = NeedingSpecifics.new
+ something.understand_the "first thing 'item' second thing 'another thing'"
+ something.value_of(:first_thing).should == "item"
+ something.value_of(:second_thing).should == "another thing"
+ end
end
context 'the last item' do

0 comments on commit 196d395

Please sign in to comment.