mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Fixed shoulda:list rake task for Rails 2.1 by adding the 'test' directory to the load path
This commit is contained in:
parent
f517592c45
commit
2f510684f2
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
namespace :shoulda do
|
||||
desc "List the names of the test methods in a specification like format"
|
||||
task :list do
|
||||
$LOAD_PATH.unshift("test")
|
||||
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
|
@ -13,7 +14,7 @@ namespace :shoulda do
|
|||
test_files.each do |file|
|
||||
load file
|
||||
klass = File.basename(file, '.rb').classify.constantize
|
||||
|
||||
|
||||
puts klass.name.gsub('Test', '')
|
||||
|
||||
test_methods = klass.instance_methods.grep(/^test/).map {|s| s.gsub(/^test: /, '')}.sort
|
||||
|
|
Loading…
Reference in a new issue