Permalink
Browse files

Use minitest

  • Loading branch information...
1 parent 86d04cd commit da7c69048c63f6bfb2694385d0f2d7e5f527251e @iain committed Jul 13, 2012
Showing with 8 additions and 19 deletions.
  1. +0 −2 Gemfile
  2. +0 −12 Rakefile
  3. +3 −0 http_accept_language.gemspec
  4. +5 −5 test/http_accept_language_test.rb
View
@@ -1,5 +1,3 @@
source :rubygems
gemspec
-gem "test-unit", ">=2.5.1"
-gem "rake"
View
@@ -3,20 +3,8 @@ require "bundler/gem_tasks"
require 'rake/testtask'
desc 'Test the http_accept_language plugin.'
Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
- t.verbose = true
end
desc 'Default: run unit tests.'
task :default => :test
-
-require 'rake/rdoctask'
-desc 'Generate documentation for the http_accept_language plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'HttpAcceptLanguage'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README.rdoc')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
@@ -14,4 +14,7 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
+
+ s.add_development_dependency 'rake'
+ s.add_development_dependency 'minitest'
end
@@ -1,6 +1,6 @@
$:.unshift(File.dirname(__FILE__) + '/../lib')
require 'http_accept_language'
-require 'test/unit'
+require 'minitest/autorun'
module ActionPack
module VERSION
@@ -27,7 +27,7 @@ def env
end
end
-class HttpAcceptLanguageTest < Test::Unit::TestCase
+class HttpAcceptLanguageTest < MiniTest::Unit::TestCase
def test_should_return_empty_array
request.env['HTTP_ACCEPT_LANGUAGE'] = nil
assert_equal [], request.user_preferred_languages
@@ -76,16 +76,16 @@ def test_should_be_included_into_actionpack_v2
end
load "http_accept_language.rb"
- assert_include ActionController::Request.ancestors, HttpAcceptLanguage
- assert_include ActionController::CgiRequest.ancestors, HttpAcceptLanguage
+ assert_includes ActionController::Request.ancestors, HttpAcceptLanguage
+ assert_includes ActionController::CgiRequest.ancestors, HttpAcceptLanguage
end
def test_should_be_included_into_actionpack_v3
silence_warnings do
ActionPack::VERSION.const_set(:MAJOR, 3)
end
load "http_accept_language.rb"
- assert_include ActionDispatch::Request.ancestors, HttpAcceptLanguage
+ assert_includes ActionDispatch::Request.ancestors, HttpAcceptLanguage
end
private

0 comments on commit da7c690

Please sign in to comment.