Sha256: 2ba1eb1bfd8b91824bbd5d681fea6306603e73d6bbdac15cff760b660d108ed1

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

require 'pathname'
require 'json'

module FixturesHelper

  # Returns path to the response examples
  def response_examples_path
    Pathname.new(File.dirname(__FILE__)).join('..','fixtures','response_examples')
  end

  # Returns the path for +sample_name+ response example file
  def response_example_path(sample_name)
    response_examples_path.join("#{sample_name}.xml")
  end

  # Returns a mock +sample_name+ response
  def response_example(sample_name)
    content = response_example_path(sample_name).read
    content.stub(:body).and_return(content)
    content
  end
end


RSpec.configure do |conf|
  conf.include FixturesHelper
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
easytobookr-0.0.1 spec/support/fixtures_helper.rb