Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make the test method available to all.

  • Loading branch information...
commit 3db163bffda277af068a6bd1936fc2d488511ad8 1 parent 97f2fa3
@cwninja cwninja authored
View
4 test/geminabox_test_case.rb
@@ -38,10 +38,6 @@ def to_app
Rack::Builder.app(&app)
end
- def test(test_name, &block)
- define_method "test: #{test_name} ", &block
- end
-
def should_push_gem(gemname = :example, *args)
test("can push #{gemname}") do
assert_can_push(gemname, *args)
View
2  test/requests/x_powered_by_test.rb
@@ -10,7 +10,7 @@ def app
end
%w[ / /gems ].each do |path|
- define_method "test: adds X-Powered-By when requesting '#{path}'" do
+ test "adds X-Powered-By when requesting '#{path}'" do
get path
assert_equal "geminabox #{GeminaboxVersion}", last_response.headers['X-Powered-By']
end
View
11 test/test_helper.rb
@@ -1,3 +1,14 @@
+require "rubygems"
+gem "bundler"
+require "bundler/setup"
require 'minitest/autorun'
require "geminabox"
require "geminabox_test_case"
+
+module TestMethodMagic
+ def test(test_name, &block)
+ define_method "test: #{test_name} ", &block
+ end
+end
+
+MiniTest::Unit::TestCase.extend TestMethodMagic
Please sign in to comment.
Something went wrong with that request. Please try again.