Sha256: 388678c4ee0b497518e8f1eb2c62bcbb6b651d50435e1f87554f6e0ab0374274

Contents?: true

Size: 739 Bytes

Versions: 3

Compression:

Stored size: 739 Bytes

Contents

module Spring
  module Commands
    class TestUnit
      def env(*)
        "test"
      end

      def call
        $LOAD_PATH.unshift "test"
        ARGV << "test" if ARGV.empty?
        ARGV.each do |arg|
          break if arg.start_with?("-")
          require_test(File.expand_path(arg))
        end
      end

      def require_test(path)
        if File.directory?(path)
          Dir[File.join path, "**", "*_test.rb"].each { |f| require f }
        else
          require path
        end
      end

      def description
        "Execute a Test::Unit test."
      end

      def fallback
        %{exec "bundle", "exec", "ruby", "-Itest", *ARGV}
      end
    end

    Spring.register_command "testunit", TestUnit.new
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
spring-commands-testunit-1.0.1 lib/spring/commands/testunit.rb
spring-commands-testunit-1.0.0 lib/spring/commands/testunit.rb
spring-0.9.0 lib/spring/commands/testunit.rb