Skip to content

Instantly share code, notes, and snippets.

@acook
Created February 14, 2014 18:48
Show Gist options
  • Save acook/9006695 to your computer and use it in GitHub Desktop.
Save acook/9006695 to your computer and use it in GitHub Desktop.
module Assertions
module_function
def assert_close_enough value1, value2
assert_equal value1.round, value2.round
end
end
require_relative 'test_helper'
class TestOtherThing < MiniTest::Unit::TestCase
def test_closeness
Assertions.assert_close_enough 1.7, 1.8
end
end
require_relative 'assertions'
require_relative 'test_helper'
class TestThing < MiniTest::Unit::TestCase
include Assertions
def test_closeness
assert_close_enough 1.5, 1.6
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment