Skip to content

Instantly share code, notes, and snippets.

@scott-stewart
Created March 7, 2012 18:27
Show Gist options
  • Save scott-stewart/1994946 to your computer and use it in GitHub Desktop.
Save scott-stewart/1994946 to your computer and use it in GitHub Desktop.
shoulda matchers in plain test::unit, somebody told me you can't use them in test::unit. I said you could, it was just ugly
require 'test_helper'
require 'shoulda/matchers'
class BlogTest < ActiveSupport::TestCase
fixtures :blogs
test "validations" do
assert validate_presence_of(:title).matches?(Blog.new)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment