1 require File.dirname(__FILE__) + '/abstract_unit'
2 require 'active_support/test_case'
3 class AssertDifferenceTest < Test::Unit::TestCase
18 if lambda { }.respond_to?(:binding)
19 def test_assert_no_difference
20 assert_no_difference '@object.num' do
25 def test_assert_difference
26 assert_difference '@object.num', +1 do
31 def test_assert_difference_with_implicit_difference
32 assert_difference '@object.num' do
37 def test_arbitrary_expression
38 assert_difference '@object.num + 1', +2 do
44 def test_negative_differences
45 assert_difference '@object.num', -1 do
50 def test_expression_is_evaluated_in_the_appropriate_scope
53 assert_difference('local_scope; @object.num') { @object.increment }
57 def test_array_of_expressions
58 assert_difference [ '@object.num', '@object.num + 1' ], +1 do
67 # These should always pass
68 class NotTestingThingsTest < Test::Unit::TestCase
69 include ActiveSupport::Testing::Default
72 class AlsoDoingNothingTest < ActiveSupport::TestCase