Methods
D
I
S
T
Instance Public methods
decrement()
# File activesupport/test/test_test.rb, line 11
def decrement
  self.num -= 1
end
default_test()
# File activesupport/test/test_test.rb, line 84
def default_test; end
increment()
# File activesupport/test/test_test.rb, line 7
def increment
  self.num += 1
end
setup()
# File activesupport/test/test_test.rb, line 4
def setup
  @object = Class.new do
    attr_accessor :num
    def increment
      self.num += 1
    end

    def decrement
      self.num -= 1
    end
  end.new
  @object.num = 0
end
test_arbitrary_expression()
# File activesupport/test/test_test.rb, line 37
def test_arbitrary_expression
  assert_difference '@object.num + 1', +2 do
    @object.increment
    @object.increment
  end
end
test_array_of_expressions()
# File activesupport/test/test_test.rb, line 57
def test_array_of_expressions
  assert_difference [ '@object.num', '@object.num + 1' ], +1 do
    @object.increment
  end
end
test_array_of_expressions_identify_failure()
# File activesupport/test/test_test.rb, line 63
def test_array_of_expressions_identify_failure
  assert_difference ['@object.num', '1 + 1'] do
    @object.increment
  end
  fail 'should not get to here'
rescue Exception => e
  assert_match(/didn't change by/, e.message)
  assert_match(/expected but was/, e.message)
end
test_array_of_expressions_identify_failure_when_message_provided()
# File activesupport/test/test_test.rb, line 73
def test_array_of_expressions_identify_failure_when_message_provided
  assert_difference ['@object.num', '1 + 1'], 1, 'something went wrong' do
    @object.increment
  end
  fail 'should not get to here'
rescue Exception => e
  assert_match(/something went wrong/, e.message)
  assert_match(/didn't change by/, e.message)
  assert_match(/expected but was/, e.message)
end
test_assert_difference()
# File activesupport/test/test_test.rb, line 25
def test_assert_difference
  assert_difference '@object.num', +1 do
    @object.increment
  end
end
test_assert_difference_with_implicit_difference()
# File activesupport/test/test_test.rb, line 31
def test_assert_difference_with_implicit_difference
  assert_difference '@object.num' do
    @object.increment
  end
end
test_assert_no_difference()
# File activesupport/test/test_test.rb, line 19
def test_assert_no_difference
  assert_no_difference '@object.num' do
    # ...
  end
end
test_expression_is_evaluated_in_the_appropriate_scope()
# File activesupport/test/test_test.rb, line 50
def test_expression_is_evaluated_in_the_appropriate_scope
  silence_warnings do
    local_scope = local_scope = 'foo'
    assert_difference('local_scope; @object.num') { @object.increment }
  end
end
test_negative_differences()
# File activesupport/test/test_test.rb, line 44
def test_negative_differences
  assert_difference '@object.num', -1 do
    @object.decrement
  end
end