small medium large xlarge

22 Feb 2012, 23:26
Elixir User (1 post)

For the following test code in the book:

test “product attributes must not be empty” do product = assert product.invalid? assert product.errors[:title].any? assert product.errors[:description].any? assert product.errors[:price].any? assert product.errors[:image_url].any? end ——————

Test result is as follows:

depot> rake test:units Loaded suite lib/rake/rake_test_loader Started

ProductTest: PASS product attributes must not be empty (0.23s)

Finished in 0.231576 seconds.

1 tests, 5 assertions, 0 failures, 0 errors, 0 skips

However I am getting different kind of output that doesn’t display details on the test executed.

depot> rake test:units Run options:

Running tests:


Finished tests in 0.116841s, 8.5586 tests/s, 42.7932 assertions/s.

1 tests, 5 assertions, 0 failures, 0 errors, 0 skips

Why is this so?

25 Feb 2012, 01:52
Sam Ruby (634 posts)

You can get still different output if you add “gem turn” to your Gemfile and then run the command “bundle install”. Previous versions of Rails included this gem depending on a number of conditions, but they found that the turn gem was evolving too quickly and caused other problems (since resolved). Should there be another update of the book (to be clear: I believe I have a pretty good track record of making updates, but as they say in the financial world “Past performance is no guarantee of future results”), I intend to resync this yet once again.

Meanwhile, if you like the functionality that the turn gem provides, go ahead and add it.

You must be logged in to comment