Sha256: 28204294717fe05828b6cf51f0efb1119a960134bf41038f52e9117e673c051c

Contents?: true

Size: 349 Bytes

Versions: 8

Compression:

Stored size: 349 Bytes

Contents

module DifferenceTestHelper

  def assert_difference(object, method = nil, difference = 1)
    initial_value = object.send(method)
    yield
    assert_equal initial_value + difference, object.send(method), "#{object}##{method}"
  end
  
  def assert_no_difference(object, method, &block)
    assert_difference object, method, 0, &block
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
radiant-0.6.3 test/helpers/difference_test_helper.rb
radiant-0.6.4 test/helpers/difference_test_helper.rb
radiant-0.6.5.1 test/helpers/difference_test_helper.rb
radiant-0.6.5 test/helpers/difference_test_helper.rb
radiant-0.6.6 test/helpers/difference_test_helper.rb
radiant-0.6.7 test/helpers/difference_test_helper.rb
radiant-0.6.9 test/helpers/difference_test_helper.rb
radiant-0.6.8 test/helpers/difference_test_helper.rb