Sha256: f7c8c9ef9888ce1bfb2bb7d9eddcd686cd6b28ff3f101506003cc615b9a3bb05

Contents?: true

Size: 836 Bytes

Versions: 209

Compression:

Stored size: 836 Bytes

Contents

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'
    require 'active_support'

    # bug in test unit.  Set to true to stop from running.
    Test::Unit.run = true

    test_files = Dir.glob(File.join('test', '**', '*_test.rb'))
    test_files.each do |file|
      load file
      klass = File.basename(file, '.rb').classify
      unless Object.const_defined?(klass.to_s)
        puts "Skipping #{klass} because it doesn't map to a Class"
        next
      end
      klass = klass.constantize

      puts klass.name.gsub('Test', '')

      test_methods = klass.instance_methods.grep(/^test/).map {|s| s.gsub(/^test: /, '')}.sort
      test_methods.each {|m| puts "  " + m }
    end
  end
end

Version data entries

209 entries across 162 versions & 30 rubygems

Version Path
challah-1.0.0.beta2 vendor/bundle/gems/shoulda-context-1.1.1/lib/shoulda/context/tasks/list_tests.rake
shoulda-context-1.1.1 lib/shoulda/context/tasks/list_tests.rake
challah-1.0.0.beta vendor/bundle/gems/shoulda-context-1.1.0/lib/shoulda/context/tasks/list_tests.rake
challah-1.0.0.beta vendor/bundle/gems/shoulda-context-1.0.1/lib/shoulda/context/tasks/list_tests.rake
challah-1.0.0.beta vendor/bundle/gems/shoulda-context-1.0.2/lib/shoulda/context/tasks/list_tests.rake
shoulda-context-1.1.0 lib/shoulda/context/tasks/list_tests.rake
challah-0.9.1.beta.3 vendor/bundle/gems/shoulda-context-1.0.1/lib/shoulda/context/tasks/list_tests.rake
devise_sociable-0.1.0 vendor/bundle/gems/shoulda-context-1.0.2/lib/shoulda/context/tasks/list_tests.rake
challah-0.9.1.beta vendor/bundle/gems/shoulda-context-1.0.1/lib/shoulda/context/tasks/list_tests.rake
challah-0.9.0 vendor/bundle/gems/shoulda-context-1.0.1/lib/shoulda/context/tasks/list_tests.rake
shoulda-context-1.0.2 lib/shoulda/context/tasks/list_tests.rake
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/tasks/list_tests.rake
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/tasks/list_tests.rake
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/shoulda-2.11.3/lib/shoulda/tasks/list_tests.rake
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/shoulda-context-1.0.1/lib/shoulda/context/tasks/list_tests.rake
challah-rolls-0.2.0 vendor/bundle/gems/shoulda-context-1.0.0/lib/shoulda/context/tasks/list_tests.rake
challah-rolls-0.2.0 vendor/bundle/gems/shoulda-context-1.0.1/lib/shoulda/context/tasks/list_tests.rake
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/shoulda-context-1.0.0/lib/shoulda/context/tasks/list_tests.rake
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/shoulda-context-1.0.0/lib/shoulda/context/tasks/list_tests.rake
challah-0.8.3 vendor/bundle/gems/shoulda-context-1.0.0/lib/shoulda/context/tasks/list_tests.rake