Sha256: 76b87c7ed1949632f79f2e325a71f32705db2d18ef99d4bcc21bc566aeb3eb6e

Contents?: true

Size: 861 Bytes

Versions: 2

Compression:

Stored size: 861 Bytes

Contents

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

require 'coveralls'
Coveralls.wear!

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)

    # Fake Rails.application
    Rails.stub(:application).and_return OpenStruct.new(config: OpenStruct.new, env_config: {})

    # 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

2 entries across 2 versions & 1 rubygems

Version Path
gaffe-1.0.1 spec/spec_helper.rb
gaffe-1.0 spec/spec_helper.rb