Sha256: 338938b4343c9f32d877dc53b82117de0a2acf12d4c2ec88460ba9c6a0fd76d9

Contents?: true

Size: 589 Bytes

Versions: 23

Compression:

Stored size: 589 Bytes

Contents

module Integration
  def spot_check(records, tests)
    headers = tests.shift
    tests.each do |test|
      where_clause = {}
      headers[0].each_with_index do |field, i|
        where_clause[field] = test[0][i]
      end
      record = records.where(where_clause).first
      record.should_not be_nil, "Expected to find a record with #{where_clause.inspect}"
      headers[1].each_with_index do |field, i|
        criterion = test[1][i]
        record.send(field).should send("be_#{criterion}"), "Expecting #{field} to be #{criterion} on #{record.inspect}"
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
earth-1.2.1 spec/support/integration.rb
earth-1.1.2 spec/support/integration.rb
earth-1.1.1 spec/support/integration.rb
earth-1.1.0 spec/support/integration.rb
earth-1.0.3 spec/support/integration.rb
earth-1.0.2 spec/support/integration.rb
earth-1.0.1 spec/support/integration.rb
earth-1.0.0 spec/support/integration.rb
earth-0.12.4 spec/support/integration.rb
earth-0.12.3 spec/support/integration.rb
earth-0.12.2 spec/support/integration.rb
earth-0.12.1 spec/support/integration.rb
earth-0.12.0 spec/support/integration.rb
earth-0.11.20 spec/support/integration.rb
earth-0.11.19 spec/support/integration.rb
earth-0.11.18 spec/support/integration.rb
earth-0.11.17 spec/support/integration.rb
earth-0.11.16 spec/support/integration.rb
earth-0.11.15 spec/support/integration.rb
earth-0.11.14 spec/support/integration.rb