Skip to content

Instantly share code, notes, and snippets.

@philnash
Last active December 31, 2015 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philnash/8037170 to your computer and use it in GitHub Desktop.
Save philnash/8037170 to your computer and use it in GitHub Desktop.
Shoulda + Minitest 5
require 'rubygems'
require 'minitest/autorun'
require 'shoulda-context'
class HelloWorld
def self.hello
"Hello world!"
end
end
class HelloWorldTest < MiniTest::Test
include ShouldaContextLoadable
should 'say hello world' do
assert_equal "Hello world!", HelloWorld.hello
end
end
$ ruby testcase.rb
MiniTest::Unit::TestCase is now Minitest::Test. From /Users/philnash/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/test/unit/testcase.rb:8:in `<module:Unit>'
Run options: --seed 59078
# Running:
Finished in 0.001670s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment