Skip to content

Instantly share code, notes, and snippets.

@mrkcor
Created February 21, 2012 06:31
Show Gist options
  • Save mrkcor/1874296 to your computer and use it in GitHub Desktop.
Save mrkcor/1874296 to your computer and use it in GitHub Desktop.
MiniTest::Spec example with both before do and setup
require_relative 'test_helper'
class TestMe
end
module TestModule
def setup
puts "This is the setup method"
end
end
describe TestMe do
include TestModule
before do
puts "This is the before block"
end
after do
puts "This is the after block"
end
it "runs a test" do
puts "It runs!"
end
describe "a method" do
before do
puts "One more before block"
end
it "runs a nested test" do
puts "It works fine"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment