Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gem 'test-unit', '>= 2.1.1'
- require 'test/unit'
- MYVERSION = '0.9.0' #Version of the class you test
- class Test_omit < Test::Unit::TestCase
- def test_omit
- omit('The following assertion fails - it will be corrected in the next release')
- assert_equal(1,2)
- end
- def test_omit_if
- omit_if(MYVERSION < '1.0.0', "Test skipped for version #{MYVERSION}")
- assert_equal(1,2)
- end
- end
- Loaded suite test
- Started
- O
- ===============================================================================
- The following assertion fails - it will be corrected in the next release [test_omit(Test_omit)]
- test.rb:10:in `test_omit'
- ===============================================================================
- O
- ===============================================================================
- Test skipped for version 0.9.0 [test_omit_if(Test_omit)]
- test.rb:15:in `test_omit_if'
- ===============================================================================
- Finished in 0.0 seconds.
- 2 tests, 0 assertions, 0 failures, 0 errors, 0 pendings, 2 omissions, 0 notifications
- 0% passed
- @Test
- public void test() {
- // this is wrong, it should be fixed some time
- Assert.assertEquals(2, new Calculator().plus(2,2));
- // this is the expected behaviour, replace the above test when the fix is available
- // Assert.assertEquals(4, new Calculator().plus(2, 2));
- }
- @Test
- public void test() {
- Assert.assertEquals(2, new Calculator().plus(2,2));
- }
- @Ignore("fix me, Calculator is giving the wrong result, see ticket BUG-12345 and delete #test() when fixed")
- @Test
- public void fixMe() {
- Assert.assertEquals(4, new Calculator().plus(2, 2));
- }
Add Comment
Please, Sign In to add comment