Skip to content

Instantly share code, notes, and snippets.

@jrhorn424
Last active August 29, 2015 13:58
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 jrhorn424/9941504 to your computer and use it in GitHub Desktop.
Save jrhorn424/9941504 to your computer and use it in GitHub Desktop.
Testing Modules with MiniTest (and Rails)
module Foo
def bar
"baz"
end
end
# Rails choking? Maybe:
# include Foo
describe Foo do
describe '.bar' do
it { Foo.bar.must_equal "baz" }
end
end
# Goal described class inherits from ActiveSupport::TestCase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment