Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

On my machine I'm getting an error when #expect is called: "wrong num…

…ber of arguments (1 for 0)"--apparently #expect is defined as a zero-argument method elsewhere. Changed #expect to #expectation so that tests pass.
  • Loading branch information...
commit 5020c11a379591801cc5848d5645268c0266c5c4 1 parent f04d8f0
@myronmarston myronmarston authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 spec/www-favicon_spec.rb
View
12 spec/www-favicon_spec.rb
@@ -18,7 +18,7 @@
it "should find from url" do
@htmls.each do |html|
- @favicon.stub!(:request).and_return expect(:body => html)
+ @favicon.stub!(:request).and_return expectaction(:body => html)
@favicon.find('http://example.com/').should == 'http://example.com/foo/favicon.ico'
end
end
@@ -30,22 +30,22 @@
end
it "should find from default path" do
- @favicon.stub!(:request).and_return(expect(:body => '<html></html>'), expect(:code => '200'))
+ @favicon.stub!(:request).and_return(expectaction(:body => '<html></html>'), expectaction(:code => '200'))
@favicon.find('http://www.example.com/').should == 'http://www.example.com/favicon.ico'
- @favicon.stub!(:request).and_return(expect(:code => '200'))
+ @favicon.stub!(:request).and_return(expectaction(:code => '200'))
@favicon.find_from_html('<html></html>', 'http://www.example.com/').should == 'http://www.example.com/favicon.ico'
end
it "should not find from default path" do
- @favicon.stub!(:request).and_return(expect(:body => '<html></html>'), expect(:code => '404'))
+ @favicon.stub!(:request).and_return(expectaction(:body => '<html></html>'), expectaction(:code => '404'))
@favicon.find('http://example.com/').should be_nil
- @favicon.stub!(:request).and_return(expect(:code => '404'))
+ @favicon.stub!(:request).and_return(expectaction(:code => '404'))
@favicon.find_from_html('<html></html>', 'http://www.example.com/').should be_nil
end
end
-def expect(attr)
+def expectaction(attr)
OpenStruct.new(attr)
end
Please sign in to comment.
Something went wrong with that request. Please try again.