Sha256: c2f397d1bf113b9ab473e5d63b997db44153b3569574e4899d5be87e9130fcbd

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 Bytes

Contents

module Test::Spec::Rails
  class DummyResponse < TestDummy

    attr_reader :body, :headers, :content_type

    def initialize(body, headers=nil)
      if headers.nil?
        response = body.instance_variable_get('@response')
        @body, @headers = response.body, response.headers
      else
        @body, @headers = body, headers
      end
      @response = self
    end
    
    def html_document
      @html_document ||= HTML::Document.new(@body)
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
test_spec_on_rails-1.1.0 lib/test/spec/rails/dummy_response.rb