Sha256: bf993b9dd014cb342c9f5b4350388453c0806e2d7e0efab70e50249d5c3faf18

Contents?: true

Size: 437 Bytes

Versions: 7

Compression:

Stored size: 437 Bytes

Contents

require 'spec_helper'

class DummUrlReader
  include UrlReader
end

describe UrlReader do
  let(:content) { File.read(File.expand_path('../test.html', __FILE__)) }
  let(:url) { 'http://www.example.com/test.html' }
  let(:read) { -> { DummUrlReader.new.read_url(url) } }

  describe '#read_url' do
    it 'should read url' do
      stub_request(:any, url).to_return(body: content)
      expect(read.call).to eq content
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
url_reader-0.2.5 spec/url_reader_spec.rb
url_reader-0.2.4 spec/url_reader_spec.rb
url_reader-0.2.3 spec/url_reader_spec.rb
url_reader-0.2.2 spec/url_reader_spec.rb
url_reader-0.2.1 spec/url_reader_spec.rb
url_reader-0.2.0 spec/url_reader_spec.rb
url_reader-0.1.0 spec/url_reader_spec.rb