Skip to content

Instantly share code, notes, and snippets.

@koheisg
Last active September 21, 2017 12:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koheisg/b88be94110576f8636352ed49d7a0b79 to your computer and use it in GitHub Desktop.
Save koheisg/b88be94110576f8636352ed49d7a0b79 to your computer and use it in GitHub Desktop.
class Hoge
  def output
    p 'a'
  end
end
require "minitest/autorun"
require "./hoge"

class TestHoge < Minitest::Test
  def setup
    @hoge = Hoge.new
  end

  def test_hoge
    assert_output(/a/) { @hoge.output }
  end
end
$ ruby hoge_test.rb
Run options: --seed 55600

# Running:

.

Finished in 0.000906s, 1103.9891 runs/s, 2207.9783 assertions/s.

1 runs, 2 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