Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f8a354c

Browse files
author
Travis Jeffery
committedAug 28, 2015
Merge pull request travisjeffery#163 from grosser/grosser/tests
nicer tests
2 parents fca0038 + 168c579 commit f8a354c

10 files changed

+21
-28
lines changed
 

‎Gemfile

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
# A sample Gemfile
21
source "https://rubygems.org"
32

4-
# gem "rails"
53
gemspec
64

75
group :development do
86
gem 'rake'
97
gem 'jeweler'
10-
end
11-
12-
group :development, :test do
138
gem 'pry'
14-
gem 'mocha', :require => false
15-
gem 'activesupport', '>= 3.0.0', '< 4.0.0', :require => "active_support/all"
9+
gem 'mocha'
10+
gem 'activesupport', '>= 3.0.0', '< 4.0.0'
1611
gem 'tzinfo'
1712
gem 'i18n'
18-
gem 'minitest', :require => 'minitest/autorun'
13+
gem 'minitest'
14+
gem 'minitest-rg'
1915
end

‎Rakefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ require 'bundler/gem_tasks'
33
require 'rake/testtask'
44
require 'rdoc/task'
55

6-
$LOAD_PATH.unshift("lib")
7-
86
Rake::RDocTask.new do |rdoc|
97
if File.exist?('VERSION')
108
version = File.read('VERSION')
@@ -21,7 +19,15 @@ Rake::RDocTask.new do |rdoc|
2119
end
2220

2321
task :test do
24-
system "cd test && ./run_tests.sh" or fail
22+
failed = Dir["test/*_test.rb"].map do |test|
23+
command = "ruby #{test}"
24+
puts
25+
puts command
26+
command unless system(command)
27+
end.compact
28+
if failed.any?
29+
abort "#{failed.count} Tests failed\n#{failed.join("\n")}"
30+
end
2531
end
2632

2733
desc 'Default: run tests'

‎test/run_tests.sh

-10
This file was deleted.

‎test/test_helper.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
require 'bundler/setup'
22
require 'minitest/autorun'
3+
require 'minitest/rg'
34

45
$VERBOSE = true # enable ruby warnings
56

67
require 'mocha/setup'
78

8-
class Minitest::Unit::TestCase
9+
class Minitest::Test
910
private
1011
# Tests to see that two times are within the given distance,
1112
# in seconds, from each other.

‎test/time_stack_item_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
require 'active_support/all'
66

7-
class TestTimeStackItem < Minitest::Unit::TestCase
7+
class TestTimeStackItem < Minitest::Test
88
def teardown
99
Timecop.return
1010
Time.zone = nil

‎test/timecop_date_parse_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative "test_helper"
22
require 'timecop'
33

4-
class TestTimecop < Minitest::Unit::TestCase
4+
class TestTimecop < Minitest::Test
55
def setup
66
t = Time.local(2008, 9, 1, 10, 5, 0) # monday
77
Timecop.travel(t)

‎test/timecop_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative "test_helper"
22
require 'timecop'
33

4-
class TestTimecop < Minitest::Unit::TestCase
4+
class TestTimecop < Minitest::Test
55
def teardown
66
Timecop.return
77
end

‎test/timecop_with_active_support_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
require_relative "test_helper"
77
require 'timecop'
88

9-
class TestTimecopWithActiveSupport < Minitest::Unit::TestCase
9+
class TestTimecopWithActiveSupport < Minitest::Test
1010
def teardown
1111
Timecop.return
1212
end

‎test/timecop_without_date_but_with_time_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative "test_helper"
22
require "time"
33

4-
class TestTimecopWithoutDateButWithTime < Minitest::Unit::TestCase
4+
class TestTimecopWithoutDateButWithTime < Minitest::Test
55
def test_loads_properly_when_time_is_required_instead_of_date
66
require 'timecop'
77
end

‎test/timecop_without_date_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative "test_helper"
22
require 'timecop'
33

4-
class TestTimecopWithoutDate < Minitest::Unit::TestCase
4+
class TestTimecopWithoutDate < Minitest::Test
55

66
def setup
77
Object.send(:remove_const, :Date) if Object.const_defined?(:Date)

0 commit comments

Comments
 (0)
This repository has been archived.