Skip to content

Commit

Permalink
Let rails include the module, or let other test frameworks include it…
Browse files Browse the repository at this point in the history
… manually... we don't want to be namespace polluters.
  • Loading branch information
tomlea committed Jun 1, 2009
1 parent 34f62f2 commit 6a7bec9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -13,7 +13,7 @@ spec = Gem::Specification.new do |s|
s.has_rdoc = true
s.extra_rdoc_files = %w(README.markdown)
s.rdoc_options = %w(--main README.markdown)
s.files = %w(MIT-LICENSE README.markdown Rakefile) + Dir.glob("{test,lib}/**/*")
s.files = %w(MIT-LICENSE README.markdown Rakefile) + Dir.glob("{test,lib,rails}/**/*")
s.require_paths = ["lib"]
s.add_dependency("mofo", ">= 0.2.0")
end
Expand Down
8 changes: 0 additions & 8 deletions lib/assert_microformats.rb
Expand Up @@ -16,7 +16,6 @@ def assert_mf_#{type} *args, &block
}

def assert_microformat(*args)

html = @response.nil? ? '' : @response.body
type = nil
properties = {}
Expand Down Expand Up @@ -44,10 +43,3 @@ def assert_microformat(*args)

end

module Test
module Unit
class TestCase
include AssertMicroformats
end
end
end
3 changes: 3 additions & 0 deletions rails/init.rb
@@ -0,0 +1,3 @@
require "assert_microformats"

Test::Unit::TestCase.send :include, AssertMicroformats
3 changes: 1 addition & 2 deletions test/assert_microformats_test.rb
@@ -1,5 +1,4 @@
require 'test_helper'
require File.join(File.dirname(__FILE__), '..', 'lib', 'assert_microformats.rb')
require File.join(File.dirname(__FILE__), 'test_helper')

class AssertMicroformatsTest < Test::Unit::TestCase

Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
@@ -1,7 +1,7 @@
RAILS_ENV = 'test'
require 'rubygems'
require 'test/unit'

require File.join(File.dirname(__FILE__), "..", "rails", "init")
module AssertMicroformatsTestData

def hcards
Expand Down

0 comments on commit 6a7bec9

Please sign in to comment.