Skip to content

Commit b6dd1b1

Browse files
committed
Fix optional redgreen requirement and add single file test runner.
1 parent 1ca2733 commit b6dd1b1

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ end
1515

1616
group :development do
1717
gem "RedCloth", "4.2.9"
18+
gem "redgreen", "1.2.2"
1819
end

Rakefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
require 'rake/testtask'
22

33
desc 'Run all tests'
4-
task :test do
4+
task :test, [:path] do |task, args|
55
ENV['RAILS_ENV'] = 'test'
66
$LOAD_PATH.unshift(File.expand_path('test'))
7-
require 'redgreen' if Gem.available?('redgreen')
7+
require 'redgreen' unless Gem::Specification.find_all_by_name('redgreen').empty?
88
require 'test/unit'
9-
Dir['test/*/**/test_*.rb'].each {|test| require "./#{test}" }
9+
if args[:path]
10+
require args[:path]
11+
else
12+
Dir['test/*/**/test_*.rb'].each {|test| require "./#{test}" }
13+
end
1014
end
1115

1216
desc 'Generate YARD Documentation'

0 commit comments

Comments
 (0)