I am a little puzzled by my problem. I am using ruby 1.8.7, rails 2.3.2. I am trying to use the "omit" function in Test Unit 2.3.0. Here is my test:
def test_create_reward_program
omit("Pending")
reward_program = RewardProgram.find_by_program_name("test_foo")
assert_equal "test_foo", reward_program.program_name
end
When I run "rake test", I get the following:
1) Error:
test_create_reward_program(AwardControllerTest):
Test::Unit::OmittedError: Pending
/test/functional/award_controller_test.rb:43:in `test_create_reward_program'
148 tests, 261 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
0% passed
I don’t know why this meant him as “mistake”, when he had to designate him as “omission”. Somebody knows?
I also noticed that this works:
def test_create_reward_program
omit "Pending" do
reward_program = RewardProgram.find_by_program_name("test_foo")
assert_equal "test_foo", reward_program.program_name
end
end
All the training materials and examples I found show that my first example should work.
source
share