Sha256: 40ebc703dc45da40a285e82331fa1841044ec65bc2def843757ebb95fcf3d69e

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

require 'spec_helper'

describe Sekken::Resolver do

  subject(:resolver) { Sekken::Resolver.new(http_test_client) }

  let(:http_test_client) {
    Class.new {

      def get(url)
        "raw_response for #{url}"
      end

    }.new
  }

  it 'resolves remote files using a simple HTTP client interface' do
    url = 'http://example.com?wsdl'

    xml = resolver.resolve(url)
    expect(xml).to eq("raw_response for #{url}")
  end

  it 'resolves local files' do
    fixture = fixture('wsdl/authentication')

    xml = resolver.resolve(fixture)
    expect(xml).to eq(File.read(fixture))
  end

  it 'simply returns any raw input' do
    string = '<xml/>'

    xml = resolver.resolve(string)
    expect(xml).to eq(string)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sekken-0.3.0 spec/sekken/resolver_spec.rb
sekken-0.2.0 spec/sekken/resolver_spec.rb
sekken-0.1.0 spec/sekken/resolver_spec.rb