Sha256: d9c72d29830cf98d361fe8060e578aaffac477cd81c4f0d3bbde49e2cee86e2e

Contents?: true

Size: 401 Bytes

Versions: 142

Compression:

Stored size: 401 Bytes

Contents

module HTMLSpecHelper
  def fake(uri, response, verb = :get)
    FakeWeb.register_uri(verb, uri, response: header(response))
  end

  def header(html)
    "HTTP/1.1 200 OK\n\n#{html}"
  end

  def onebox_view(html)
    %|<div class="onebox">#{html}</div>|
  end

  def response(file)
    file = File.join("spec", "fixtures", "#{file}.response")
    File.exists?(file) ? File.read(file) : ""
  end
end

Version data entries

142 entries across 142 versions & 1 rubygems

Version Path
onebox-1.5.64 spec/support/html_spec_helper.rb
onebox-1.5.63 spec/support/html_spec_helper.rb
onebox-1.5.62 spec/support/html_spec_helper.rb
onebox-1.5.61 spec/support/html_spec_helper.rb
onebox-1.5.60 spec/support/html_spec_helper.rb
onebox-1.5.50 spec/support/html_spec_helper.rb
onebox-1.5.49 spec/support/html_spec_helper.rb
onebox-1.5.48 spec/support/html_spec_helper.rb
onebox-1.5.47 spec/support/html_spec_helper.rb
onebox-1.5.45 spec/support/html_spec_helper.rb
onebox-1.5.44 spec/support/html_spec_helper.rb
onebox-1.5.43 spec/support/html_spec_helper.rb
onebox-1.5.42 spec/support/html_spec_helper.rb
onebox-1.5.41 spec/support/html_spec_helper.rb
onebox-1.5.40 spec/support/html_spec_helper.rb
onebox-1.5.39 spec/support/html_spec_helper.rb
onebox-1.5.38 spec/support/html_spec_helper.rb
onebox-1.5.37 spec/support/html_spec_helper.rb
onebox-1.5.36 spec/support/html_spec_helper.rb
onebox-1.5.35 spec/support/html_spec_helper.rb