Skip to content

Instantly share code, notes, and snippets.

/err.rb Secret

Created October 24, 2016 23:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7a6f490c82a70bcc111297b116cb1f4c to your computer and use it in GitHub Desktop.
Save anonymous/7a6f490c82a70bcc111297b116cb1f4c to your computer and use it in GitHub Desktop.
context "parsing xml" do
it "opens xml from a valid url" do
local_xml = Nokogiri::XML(open('spec/fixtures/macbeth.xml'))
parser = Nokogiri::XML(open(VALID_URL))
expect(Kernel).to receive(:open).with(VALID_URL) { local_xml }
end
Failures:
1) Parser parsing xml opens xml from a valid url
Failure/Error: expect(Kernel).to receive(:open).with(VALID_URL) { local_xml }
(Kernel).open("http://www.ibiblio.org/xml/examples/shakespeare/macbeth.xml")
expected: 1 time with arguments: ("http://www.ibiblio.org/xml/examples/shakespeare/macbeth.xml")
received: 0 times
# ./spec/parser_spec.rb:14:in `block (3 levels) in <top (required)>'
Finished in 0.77997 seconds (files took 0.11547 seconds to load)
2 examples, 1 failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment