Sha256: d2d34e5df1d9d52961085eace4ab055ab1e6e618b44188d36acacd2e126df6fd

Contents?: true

Size: 699 Bytes

Versions: 1

Compression:

Stored size: 699 Bytes

Contents

$:.unshift File.expand_path('../../lib', __FILE__)

require 'rspec'
require "action_controller/railtie"
require 'gaffe'

RSpec.configure do |config|
  config.before(:each) do
    # Fake Rails.root
    Rails.stub(:root).and_return(RAILS_ROOT)

    # Make sure we clear memoized variables before each test
    [:@configuration].each do |variable|
      Gaffe.send :remove_instance_variable, variable if Gaffe.instance_variable_defined?(variable)
    end
  end
end

# We need a fake "ApplicationController" because Gaffe's default controller inherits from it
class ApplicationController < ActionController::Base
end

# We need Rails.root
RAILS_ROOT = Pathname.new(File.expand_path('../../', __FILE__))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gaffe-0.2.1 spec/spec_helper.rb