Skip to content

Instantly share code, notes, and snippets.

@cpruitt
Forked from CoryFoy/gist:2369535
Created April 12, 2012 18:22
Show Gist options
  • Select an option

  • Save cpruitt/2369808 to your computer and use it in GitHub Desktop.

Select an option

Save cpruitt/2369808 to your computer and use it in GitHub Desktop.
it "opens the file correctly" do
file_path = "/some/path/to.xml"
xml = "<xml>bleh</xml>"
stub_file = stub("fake_file")
stub_file.stub(:read).and_return(xml)
File.stub(:open).and_return(stub_file)
reader = Wastead::DataReader::XMLReader.new()
reader.should_receive(:process_xml).with(xml)
reader.process(file_path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment