Sha256: e3106f683433280eb2a0a4547c5d438616fe22a9b2f254cc4c85e7549b526440

Contents?: true

Size: 693 Bytes

Versions: 5

Compression:

Stored size: 693 Bytes

Contents

# encoding: utf-8
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

if ENV['coverage']
  raise "simplecov only works on Ruby 1.9" unless RUBY_VERSION =~ /^1\.9/

  require 'simplecov'
  SimpleCov.start { add_filter "spec/" }
end

require 'rspec'

require 'data_magic'

RSpec::Matchers.define :have_field_value do |expected|
  match do |actual|
    actual['field'] == expected
  end
  
  failure_message do |actual|
    "expected '#{expected}' to equal the field value '#{actual['field']}'"
  end
  
  failure_message_when_negated do |actual|
    "expected '#{expected}' to not equal to field value '#{actual['field']}'"
  end
end


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
data_magic-1.1 spec/spec_helper.rb
data_magic-1.0 spec/spec_helper.rb
data_magic-0.22 spec/spec_helper.rb
data_magic-0.21 spec/spec_helper.rb
data_magic-0.20 spec/spec_helper.rb