Skip to content

Commit 709bf4b

Browse files
author
Carl Brasic
committed
Use rake as test runner instead of custom script
1 parent ba65028 commit 709bf4b

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

Rakefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require "rake/testtask"
2+
3+
task default: "test"
4+
5+
Rake::TestTask.new do |t|
6+
t.test_files = FileList['test/test_helper.rb', 'test/**/*_test.rb']
7+
end

scientist.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ Gem::Specification.new do |gem|
1919

2020
gem.add_development_dependency "minitest", "~> 5.8"
2121
gem.add_development_dependency "coveralls", "~> 0.8"
22+
gem.add_development_dependency "rake"
2223
end

script/test

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@
44
set -e
55

66
cd $(dirname "$0")/..
7-
script/bootstrap && bundle exec ruby -I lib \
8-
-e 'require "bundler/setup"' \
9-
-e 'require "coveralls"; Coveralls.wear!{ add_filter ".bundle" }' \
10-
-e 'require "minitest/autorun"' \
11-
-e 'require "scientist"' \
12-
-e '(ARGV.empty? ? Dir["test/**/*_test.rb"] : ARGV).each { |f| load f }' -- "$@"
7+
script/bootstrap && bundle exec rake test

test/test_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require "minitest/autorun"
2+
3+
$LOAD_PATH.unshift(File.expand_path(File.join(__dir__, "../lib")))
4+
require "scientist"

0 commit comments

Comments
 (0)