0

We actually do not use test within our application (I know that's bad and sad). I have reads a lot about Test::Unit, Shouda, minitest and the new one Bacon. But cannot make my mind yet. Basically our needs are :

  • Use of watir (love it)
  • Easy to learn
  • Do not mess with the application (like Rspec generator - not against rspec)
  • Integration with rails 3
  • No clients will have to read it, only dev.

What do you think ?

4 Answers 4

2

I actually abandoned Test::Unit and switched to RSpec 2. Only developers have to read our tests, but RSpec seems to encourage better structured tests than Test::Unit. It's different to most other testing frameworks though, so there's a small learning curve, but only for the first few days.

I also strongly advise that you don't use Rails' fixtures and you take a look at Machinist.

Sign up to request clarification or add additional context in comments.

1 Comment

Have to second this. Personally I find Rspec much easier to use than Test::Unit. It doesn't mess with the application that much since everything is kept contained in the spec/ directory. Also for a popular alternative to Machinist, take a look at Factory Girl. github.com/thoughtbot/factory_girl_rails
2

I would go for minitest as its the default in Ruby 1.9.2 (replacing test/unit) and use the test/unit format as it's something that a lot of developers are familiar with

Comments

1

Your last bullet point leads me to recommend Test::Unit. If you don't need the tests to be client readable, Test::Unit is much more straightforward, and doesn't require as much knowledge of the test framework before you can get started. It looks like it integrates with Watir (although I haven't used it for that).

I'm sure you'll get lots of suggestions for each of the frameworks you listed, I'd say just pick one and start writing tests!

Comments

0

I would recommend Test::Unit/Minitest along with the others here. You can also install Shoulda or use something like this to provide Test::Unit with syntax like so:

class TestStuff < Test::Unit::TestCase
  def setup
    @foo = Klass.new
  end

  should "be of class Klass" do
    assert_equal Klass, @foo.class
  end

end

Have you thought of using Capybara instead of Watir?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.