Skip to content

Conversation

@qrush
Copy link

@qrush qrush commented Dec 21, 2012

Run the entire test suite:

test

Run a directory of tests:

test "unit"

Run an entire test:

test "unit/upload"

Run a specific test:

irb(main):002:0> test "unit/upload:123"
No tests found on line 123. Valid tests to run:
  test_create: m test/unit/upload_test.rb:4
...
=> true

Some problems with this:

  • You need to have the rails console in test environment to use this.
  • I killed the print_test_usage help for now.
  • This only works with 1.9+, MiniTest, or Test/Unit right now.
  • Forking to run tests and canceling them causes MySQL to barf: ActiveRecord::StatementInvalid: Mysql2::Error: MySQL server has gone away mysql_errno=2006 sqlstate=HY000: SELECT @@FOREIGN_KEY_CHECKS
  • MiniTest spits this out for me on killing the console, not sure why yet or if this is normal:
/Users/qrush/.rbenv/versions/1.9.3-p327/lib/ruby/1.9.1/test/unit.rb:49:in `process_args': invalid option: --readline (OptionParser::InvalidOption)
  from /Users/qrush/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/minitest-2.12.1/lib/minitest/unit.rb:956:in `_run'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant