TODO: <Insert clever marketing phrase here>
This is basically the same as my original blog post Duck Test Quick Start. The only difference is that I am running it on a Mac. I love the Mac. I wish I could afford one.
Create a new rails app named test.com
rails new test.com --skip-bundle
Edit test.com/Gemfile and add the following to your test group
group :test do # ... existing gems gem 'turn', :require => false gem 'duck_test' end
Generate a scaffold with some tests, then, migrate and prepare the test environment
rails g scaffold book author:string title:string rake db:migrate rake test:prepare
Run the Rails console
rails c test
Edit one of the test files: test/unit/book_test.rb
require 'test_helper' class BookTest < ActiveSupport::TestCase test "the truth" do assert false end end
Look at the Rails console and you should see that the test automagically ran and failed. Go back and change the assert from false to true and save. The test should run again and pass.
To see it in action, have a look at the following video: http://www.youtube.com/watch?v=J6HOIxvhZh4