Sha256: 143709a8a70f481861f8256124ae04b8b9375e9797c76bf58fc4e4fdd16ee821

Contents?: true

Size: 969 Bytes

Versions: 1

Compression:

Stored size: 969 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'

describe "OEmbed::Formatter::XML::Backends::REXML" do
  include OEmbedSpecHelper

  before(:all) do
    lambda {
      OEmbed::Formatter::XML.backend = 'REXML'
    }.should_not raise_error
    
    (!!defined?(REXML)).should == true
  end

  it "should support XML" do
    proc { OEmbed::Formatter.supported?(:xml) }.
    should_not raise_error(OEmbed::FormatNotSupported)
  end
  
  it "should be using the XmlSimple backend" do
    OEmbed::Formatter::XML.backend.should == OEmbed::Formatter::XML::Backends::REXML
  end
  
  it "should decode an XML String" do
    decoded = OEmbed::Formatter.decode(:xml, valid_response(:xml))
    # We need to compare keys & values separately because we don't expect all
    # non-string values to be recognized correctly.
    decoded.keys.should == valid_response(:object).keys
    decoded.values.map{|v|v.to_s}.should == valid_response(:object).values.map{|v|v.to_s}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-oembed-0.8.1 spec/formatter/xml/rexml_backend_spec.rb