Sha256: 9ecd0ebb84c67241ea89d042bcd107d512c99b5f75749523e66e7beb7409c77e

Contents?: true

Size: 928 Bytes

Versions: 3

Compression:

Stored size: 928 Bytes

Contents

require 'rspec'
begin
  require 'active_model'
rescue LoadError => err
  puts "Running specs without active_model extension"
end
require 'fakeweb'

require File.dirname(__FILE__) + '/../lib/valvat.rb'

$fakeweb = true

RSpec.configure do |config|
  config.mock_with :rspec
  config.filter_run :focus => true
  config.run_all_when_everything_filtered = true
  config.backtrace_exclusion_patterns = [/rspec\/(core|expectations)/]
end

if defined?(ActiveModel)
  class ModelBase
    include ActiveModel::Serialization
    include ActiveModel::Validations

    attr_accessor :attributes

    def initialize(attributes = {})
      @attributes = attributes
    end

    def read_attribute_for_validation(key)
      @attributes[key]
    end
  end
end

def without_any_web_requests!
  before(:all) do
    FakeWeb.clean_registry
    FakeWeb.allow_net_connect = false
  end
  after(:all) do
    FakeWeb.allow_net_connect = true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
valvat-0.6.7 spec/spec_helper.rb
valvat-0.6.6 spec/spec_helper.rb
valvat-0.6.5 spec/spec_helper.rb