Sha256: 25087c1a6123feeacafb1d1611716f4783f84fa33fdd117325aef007c756d26c

Contents?: true

Size: 1.55 KB

Versions: 33

Compression:

Stored size: 1.55 KB

Contents

# encoding: utf-8

require 'helper'

class TestChanges < MiniTest::Unit::TestCase

  def test_scores
    game1 = Game.new
    game1.score1 = 1
    game1.score2 = 2

    game2 = Game.new
    game2.score1   = 1
    game2.score2   = 1
    game2.score1p  = 5
    game2.score2p  = 3

    game_attribs = {
      score1: 1,
      score2: 2,
      score1et: nil,
      score2et: nil,
      score1p:  nil,
      score2p:  nil
    }
    
    assert_equal  false, game1.check_for_changes( game_attribs )
    assert_equal  true,  game2.check_for_changes( game_attribs )
  end
  
  def test_play_at
    game1 = Game.new
    game1.score1 = 1
    game1.score2 = 2
    game1.play_at = DateTime.new( 2012, 11, 5 )

    game2 = Game.new
    game2.score1   = 1
    game2.score2   = 2
    game2.play_at = DateTime.new( 2012, 12, 24 )

    game_attribs = {
      score1:  1,
      score2:  2,
      play_at: DateTime.new( 2012, 11, 5 )
    }
    
    assert_equal  false, game1.check_for_changes( game_attribs )
    assert_equal  true,  game2.check_for_changes( game_attribs )
  end

  def test_group_id
    game1 = Game.new
    game1.score1 = 1
    game1.score2 = 2
    game1.group_id = 1

    game2 = Game.new
    game2.score1   = 1
    game2.score2   = 2
    game2.group_id = 2

    game_attribs = {
      score1:  1,
      score2:  2,
      group_id: 1
    }
    
    assert_equal  false, game1.check_for_changes( game_attribs )
    assert_equal  true,  game2.check_for_changes( game_attribs )
  end

  
end # class TestChanges

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
sportdb-1.9.8 test/test_changes.rb
sportdb-1.9.7 test/test_changes.rb
sportdb-1.9.6 test/test_changes.rb
sportdb-1.9.5 test/test_changes.rb
sportdb-1.9.4 test/test_changes.rb
sportdb-1.9.3 test/test_changes.rb
sportdb-1.9.2 test/test_changes.rb
sportdb-1.9.1 test/test_changes.rb
sportdb-1.9.0 test/test_changes.rb
sportdb-1.8.29 test/test_changes.rb
sportdb-1.8.28 test/test_changes.rb
sportdb-1.8.27 test/test_changes.rb
sportdb-1.8.26 test/test_changes.rb
sportdb-1.8.25 test/test_changes.rb
sportdb-1.8.24 test/test_changes.rb
sportdb-1.8.23 test/test_changes.rb
sportdb-1.8.22 test/test_changes.rb
sportdb-1.8.21 test/test_changes.rb
sportdb-1.8.20 test/test_changes.rb
sportdb-1.8.19 test/test_changes.rb