crowbar/barclamp-crowbar — pull request #325 by jamestyj (2013-01-04 17:35:25+00:00)
Title: [Ruby 1.9] Fix broken CMDB spec tests

`assert` is incorrectly used here, since it just tests that the first
argument is `true`, which in Ruby means _any_ object (eg. 0, 1, "", [],
{}) except `false` and `nil`.

Ruby 1.9 is stricter here and checks that the second argument is a
`String` or `Proc`, thus uncovering the bug/typo. `assert_equal` should
be used here instead.

Also ensure that the order of the two arguments of `assert_equal` is
correct. That is, expected result first followed by actual. This
prevents confusion when reading the error messages in failing tests.

This patch exposes the following test failure that was hidden
previously:

````
1) cmdb proposal manipulation start a run for a proposal can create a test proposal with 2 nodes
Failure/Error: assert_equal 1, CmdbEvent.all.length
Test::Unit::AssertionFailedError:
<1> expected but was
<0>.
# (eval):2:in `send'
# (eval):2:in `assert_equal'
# ./spec/models/cmdb_spec.rb:87
````