Sha256: f6ef338c2fe2231b4b11883b005109d8fbc31b7ec0e5b63ddd9ce032628301b0
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
require File.join(File.dirname(__FILE__), "..", "..", "spec_helper.rb") describe Smoke::Output::XML do before do @tree = :tree @items = [ {:id => 1, :class => "first", :type => "mammal", :animal => "monkey"}, {:id => 2, :class => "second", :type => "mammal", :animal => "elephant"} ] @xml = Smoke::Output::XML.generate(@tree, @items) @document = Nokogiri::XML(@xml) end it "should respond to generate" do Smoke::Output::XML.should respond_to(:generate) end it "should start the tree off with a named key" do @document.css("tree").should_not be_nil end it "should contain items" do @document.css("items").each do |item| item.content.should =~ /monkey/ end end end describe "Smoke XML output with real data" do before :all do @url = "http://domain.tld/feed.json" FakeWeb.register_uri(:get, @url, :response => File.join(SPEC_DIR, 'supports', 'flickr-photo.json')) Smoke.data :real_xml_output do url "http://domain.tld/feed.json", :type => :json path :photos, :photo end end it "should not error" do Smoke.real_xml_output.output(:xml).should include "<?xml" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
smoke-0.5.17 | spec/smoke/output/xml_spec.rb |