Ok. Switching to Minitest. So there.

I hack my way through many things that are Ruby.

By "Ruby" I mean Rails, with a back door in to learning Ruby. So, I buy books. And I read. And I buy more. And read more. And follow Rails examples. And pick up more Ruby stuff. And learn Ruby. And do more Rails stuff. And always try to stay on top of the gem curve and use "the thing" everyone is using.

So, my test suite has been the standard FactorGirl, Rspec, Cucumber (when partnering with morons who somehow STILL COULDN'T follow the logic of ENGLISH), Selenium, running tests headless, Capybara, database cleaner and all that stuff. All highly normal.

Every so often I'd encounter a test that would utterly fail while my code worked perfectly. I'd find a way through it. Throw in more code behind the testing. Do a lot of outside-in stuff. And eventually, usually, when I'd run into an issue, it was with the test not behaving as anticipated while the code worked fine.

Then, one night (two nights ago), one such issue was taking place. This is actually not at all true. I had working code. I had the actual page open in a browser. I then made a code change, but was tired and forgot. And I got so mad at the test failing I decided I was NEVER going to test again.

Or test differently again.

I went with that.

A friend of mine once told me I consume a lot of tools.

No more.

Rails 4.2 ships with minitest as the default test engine.

I am using that.

PERIOD.

Capybara is also part of it for Behavior Driven Development.

I am just now in to my first test using the pair for an integration test (not a feature in the spec-style) and it actually seems to make sense to me. For the first time I am understanding what the test is actually doing even though the language is not as obscured as it is with DSL stuff like Cucumber and RSPEC.

Convincing me to go this direction were comments in various articles that said Minitest is just Ruby. If you get stuck, just write Ruby. You don't have to worry about DSL stuff or gems. Just do something in Ruby.

I figure what better way to learn Ruby better than to use it for testing my Rails app.

Maybe one day I'll add these back to my testing stack.

But, for today, I'll make at least one friend happy by consuming several fewer tools :).

I may even write about it as I learn it as there is precious little out there about Minitest compared to RSPEC.

Back
paperclip paperclip