Module: Bake::Test

Defined in:
lib/bake/test/detect.rb,
lib/bake/test/runner.rb,
lib/bake/test/version.rb

Defined Under Namespace

Modules: Runner

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.detect(root) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/bake/test/detect.rb', line 8

def self.detect(root)
	if exist?(root, "spec")
		return :rspec
	elsif exist?(root, "config/sus.rb")
		return :sus
	elsif exist?(root, "test")
		return :sus
	elsif exist?(root, "Rakefile") || exist?(root, "rakefile")
		return :rake
	end
end

.exist?(root, path) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/bake/test/detect.rb', line 20

def self.exist?(root, path)
	File.exist?(File.join(root, path))
end