diff --git a/Rakefile b/Rakefile index 61ecd01..60d77c8 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/lib/assert_microformats.rb b/lib/assert_microformats.rb index 221e5b2..e0ff15d 100644 --- a/lib/assert_microformats.rb +++ b/lib/assert_microformats.rb @@ -16,7 +16,6 @@ def assert_mf_#{type} *args, &block } def assert_microformat(*args) - html = @response.nil? ? '' : @response.body type = nil properties = {} @@ -44,10 +43,3 @@ def assert_microformat(*args) end -module Test - module Unit - class TestCase - include AssertMicroformats - end - end -end diff --git a/rails/init.rb b/rails/init.rb new file mode 100644 index 0000000..7c541ad --- /dev/null +++ b/rails/init.rb @@ -0,0 +1,3 @@ +require "assert_microformats" + +Test::Unit::TestCase.send :include, AssertMicroformats diff --git a/test/assert_microformats_test.rb b/test/assert_microformats_test.rb index 8d1baf0..a173eec 100644 --- a/test/assert_microformats_test.rb +++ b/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 diff --git a/test/test_helper.rb b/test/test_helper.rb index b6d163e..c478d0c 100644 --- a/test/test_helper.rb +++ b/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