Created
February 21, 2012 06:31
-
-
Save mrkcor/1874296 to your computer and use it in GitHub Desktop.
MiniTest::Spec example with both before do and setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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