From 8f5c83bdeac2d345f3ec55ecb6460a76c4450a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20L=C3=BCtke?= Date: Tue, 1 May 2007 21:02:37 +0000 Subject: Added assert_difference and assert_no_difference to test/unit assertions git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/test_test.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 activesupport/test/test_test.rb (limited to 'activesupport/test/test_test.rb') diff --git a/activesupport/test/test_test.rb b/activesupport/test/test_test.rb new file mode 100644 index 0000000000..63a44e9379 --- /dev/null +++ b/activesupport/test/test_test.rb @@ -0,0 +1,34 @@ +require File.dirname(__FILE__) + '/abstract_unit' + +class AssertDifferenceTest < Test::Unit::TestCase + + def setup + @object = Class.new { attr_accessor :num }.new + end + + def test_assert_no_difference + @object.num = 0 + + assert_no_difference @object, :num do + # ... + end + + end + def test_assert_difference + @object.num = 0 + + + assert_difference @object, :num, +1 do + @object.num = 1 + end + + end + + def test_methods_available + + assert self.respond_to?(:assert_difference) + assert self.respond_to?(:assert_no_difference) + + end + +end -- cgit v1.2.3