Sha256: eeabe85d46762f52379a80f0d8a299e0e080b6e88fd5cee5a1be6f4553c04b6f

Contents?: true

Size: 1.17 KB

Versions: 9

Compression:

Stored size: 1.17 KB

Contents

require 'machinist/active_record'
require 'sham'
require 'faker'
require 'polyamorous'

Time.zone = 'Eastern Time (US & Canada)'

Dir[File.expand_path('../{helpers,support,blueprints}/**/*.rb', __FILE__)]
.each do |f|
  require f
end

Sham.define do
  name     { Faker::Name.name }
  title    { Faker::Lorem.sentence }
  body     { Faker::Lorem.paragraph }
  salary   { |index| 30000 + (index * 1000) }
  tag_name { Faker::Lorem.words(3).join(' ') }
  note     { Faker::Lorem.words(7).join(' ') }
end

RSpec.configure do |config|
  config.before(:suite) do
    message = "Running Polyamorous specs with #{
      ActiveRecord::Base.connection.adapter_name
      }, Active Record #{::ActiveRecord::VERSION::STRING}, Arel #{Arel::VERSION
      } and Ruby #{RUBY_VERSION}"
    line = '=' * message.length
    puts line, message, line
    Schema.create
  end
  config.before(:all)   { Sham.reset(:before_all) }
  config.before(:each)  { Sham.reset(:before_each) }

  config.include PolyamorousHelper
end

RSpec::Matchers.define :be_like do |expected|
  match do |actual|
    actual.gsub(/^\s+|\s+$/, '').gsub(/\s+/, ' ').strip ==
      expected.gsub(/^\s+|\s+$/, '').gsub(/\s+/, ' ').strip
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
polyamorous-1.3.3 spec/spec_helper.rb
polyamorous-1.3.2 spec/spec_helper.rb
polyamorous-1.3.1 spec/spec_helper.rb
polyamorous-1.3.0 spec/spec_helper.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/polyamorous-1.2.0/spec/spec_helper.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/polyamorous-1.2.0/spec/spec_helper.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/polyamorous-1.2.0/spec/spec_helper.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/polyamorous-1.2.0/spec/spec_helper.rb
polyamorous-1.2.0 spec/spec_helper.rb