Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Made .see? spec use the new `eyes` helper method.

  • Loading branch information...
commit aae0940a8108713af0b54634aa3b627d6aec6600 1 parent 7e49026
@runpaint authored
Showing with 18 additions and 11 deletions.
  1. +18 −11 spec/eye/see_spec.rb
View
29 spec/eye/see_spec.rb
@@ -1,29 +1,36 @@
describe "Eye.see" do
-
- before(:each) do
- @eye = Eye.new
- end
+ include HelperMethods
it "is a method" do
- @eye.should.respond_to? :see
+ eyes.each do |eye|
+ eye.should.respond_to? :see
+ end
end
it "takes a single argument" do
- lambda{@eye.see("string")}.should_not raise_error
+ eyes.each do |eye|
+ lambda{eye.see("string")}.should_not raise_error
+ end
end
it "raises an ArgumentError if called without arguments" do
- lambda{@eye.see}.should raise_error(ArgumentError)
+ eyes.each do |eye|
+ lambda{eye.see}.should raise_error(ArgumentError)
+ end
end
it "raises an ArgumentError if called with more than one argument" do
- lambda{@eye.see(1,2)}.should raise_error(ArgumentError)
- lambda{@eye.see("string",['glark'],"bar")}.should raise_error(ArgumentError)
+ eyes.each do |eye|
+ lambda{eye.see(1,2)}.should raise_error(ArgumentError)
+ lambda{eye.see("string",['glark'],"bar")}.should raise_error(ArgumentError)
+ end
end
it "returns true if the object was recorded" do
- ['Kim', 'http://example.com/'].each do |obj|
- @eye.see(obj).should == true
+ eyes.each do |eye|
+ ['Kim', 'http://example.com/'].each do |obj|
+ eye.see(obj).should == true
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.