Sha256: 8a7e04ff4a8b72dad275a9b3cbef8327f80759d483ea659188d227a0c95d9d1d

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

require "spec_helper"

describe Savon::Wasabi::Document do

  context "with a remote document" do
    before do
      response = HTTPI::Response.new 200, {}, Fixture.wsdl(:authentication)
      HTTPI.stubs(:get).returns(response)
    end

    it "should resolve via HTTP" do
      wsdl = Savon::Wasabi::Document.new("http://example.com?wsdl")
      wsdl.xml.should == Fixture.wsdl(:authentication)
    end

    it "should resolve via HTTPS" do
      wsdl = Savon::Wasabi::Document.new("https://example.com?wsdl")
      wsdl.xml.should == Fixture.wsdl(:authentication)
    end
  end

  context "with a local document" do
    before do
      HTTPI.expects(:get).never
    end

    it "should read the file" do
      wsdl = Savon::Wasabi::Document.new("spec/fixtures/wsdl/authentication.xml")
      wsdl.xml.should == Fixture.wsdl(:authentication)
    end
  end

  context "with raw XML" do
    before do
      HTTPI.expects(:get).never
      File.expects(:read).never
    end

    it "should use the raw XML" do
      wsdl = Savon::Wasabi::Document.new Fixture.wsdl(:authentication)
      wsdl.xml.should == Fixture.wsdl(:authentication)
    end
  end

end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/savon-0.9.5/spec/savon/wasabi/document_spec.rb
savon-0.9.8 spec/savon/wasabi/document_spec.rb
they-savon-0.9.7.1 spec/savon/wasabi/document_spec.rb
regenersis-savon-1.0.0 spec/savon/wasabi/document_spec.rb
they-savon-0.9.7 spec/savon/wasabi/document_spec.rb
savon-0.9.7 spec/savon/wasabi/document_spec.rb
savon-0.9.6 spec/savon/wasabi/document_spec.rb
savon-0.9.5 spec/savon/wasabi/document_spec.rb
savon-0.9.4 spec/savon/wasabi/document_spec.rb