Skip to content

Instantly share code, notes, and snippets.

@mejarc
Created January 16, 2014 23:53
Show Gist options
  • Save mejarc/8465857 to your computer and use it in GitHub Desktop.
Save mejarc/8465857 to your computer and use it in GitHub Desktop.
# foo_test.rb
class Meme
def i_can_has_cheezburger?
"OHAI!"
end
def will_it_blend?
"YES!"
end
end
# === Unit tests
require 'minitest/autorun'
class TestMeme < Minitest::Unit::TestCase
def setup
@meme = Meme.new
end
def test_that_kitty_can_eat
assert_equal "OHAI!", @meme.i_can_has_cheezburger?
end
def test_that_it_will_not_blend
refute_match /^no/i, @meme.will_it_blend?
end
def test_that_will_be_skipped
skip "test this later"
end
end
__END__
$ ruby foo_test.rb
MiniTest::Unit::TestCase is now Minitest::Test. From foo_test.rb:15:in `<main>'
Run options: --seed 7807
# Running:
..S
Finished in 0.001897s, 1581.6545 runs/s, 1581.6545 assertions/s.
3 runs, 3 assertions, 0 failures, 0 errors, 1 skips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment