Created
May 22, 2012 19:20
-
-
Save greggersh/2771074 to your computer and use it in GitHub Desktop.
Stubbing Nokogiri
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doc = Nokogiri::XML(open(Rails.root + 'spec/support/tesoriere.xml')) | |
Nokogiri::XML::Document.stub!(:parse) | |
Nokogiri::XML::Document.should_receive(:parse).and_return(doc) | |
# from http://tesoriere.com/2011/05/19/testing-with-remote-xml-in-rails-3.1-using-nokogiri-and-stubs/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment