Created
May 22, 2017 00:59
-
-
Save rlgreen91/d4baed7633ebc6604335d72e9c7c3fa7 to your computer and use it in GitHub Desktop.
Initialize method for Rake::TestTask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a testing task. | |
def initialize(name=:test) | |
@name = name | |
@libs = ["lib"] | |
@pattern = nil | |
@options = nil | |
@test_files = nil | |
@verbose = false | |
@warning = true | |
@loader = :rake | |
@ruby_opts = [] | |
@description = "Run tests" + (@name == :test ? "" : " for #{@name}") | |
@deps = [] | |
if @name.is_a?(Hash) | |
@deps = @name.values.first | |
@name = @name.keys.first | |
end | |
yield self if block_given? | |
@pattern = "test/test*.rb" if @pattern.nil? && @test_files.nil? | |
define | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment