Sha256: 31688fa8c2d2aaf75f6bdb8754601a206f63fd512d23c74b4c503fb1208d3a72

Contents?: true

Size: 906 Bytes

Versions: 4

Compression:

Stored size: 906 Bytes

Contents

require 'test_helper'

class Brewery
  def self.is_microbrew?(row)
    row[:volume] < 500
  end
end

class ErrataTest < Test::Unit::TestCase
  def setup
    @e = Errata.new(:url => 'http://static.brighterplanet.com/science/data/transport/automobiles/make_fleet_years/errata.csv')
  end
  
  should "return implied matching methods" do
    flunk "create a fake errata for Brewery"
  end
  
  should "use matching methods" do
    flunk "create a fake errata for Brewery"
  end
  
  should "correct rows" do
    rover = { 'manufacturer_name' => 'foobar Austin Rover foobar' }
    mercedes = { 'manufacturer_name' => 'MERCEDES' }
    @e.correct!(mercedes)
    @e.correct!(rover)
    assert_equal 'Mercedes-Benz', mercedes['manufacturer_name']
    assert_equal 'Rover',         rover['manufacturer_name']
  end
  
  should "reject rows" do
    assert @e.rejects?('manufacturer_name' => 'AURORA CARS')
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
seamusabshere-errata-0.1.2 test/errata_test.rb
seamusabshere-errata-0.1.3 test/errata_test.rb
seamusabshere-errata-0.1.4 test/errata_test.rb
errata-0.1.4 test/errata_test.rb