Module: Matcha
- Defined in:
- lib/matcha.rb,
lib/matcha/engine.rb,
lib/matcha/runner.rb,
lib/matcha/server.rb,
app/models/matcha/spec.rb,
app/controllers/matcha/specs_controller.rb
Defined Under Namespace
Classes: Engine, Runner, Server, Spec, SpecsController
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.mode ⇒ Object
Returns the value of attribute mode.
7
8
9
|
# File 'lib/matcha.rb', line 7
def mode
@mode
end
|
Class Method Details
.config ⇒ Object
21
22
23
|
# File 'lib/matcha.rb', line 21
def config
Matcha::Engine.config.matcha
end
|
25
26
27
|
# File 'lib/matcha.rb', line 25
def configure
yield config
end
|
.run ⇒ Object
16
17
18
19
|
# File 'lib/matcha.rb', line 16
def run
self.mode = :runner
Matcha::Runner.start
end
|
.serve ⇒ Object
9
10
11
12
13
14
|
# File 'lib/matcha.rb', line 9
def serve
puts "your tests are here:"
puts " http://localhost:#{port}/"
self.mode = :server
Matcha::Server.start
end
|
.spec_paths ⇒ Object
35
36
37
38
39
|
# File 'lib/matcha.rb', line 35
def spec_paths
Dir[File.join(spec_root, "**/*_spec.*")].map do |path|
path.gsub(File.join(spec_root, ''), '')
end
end
|
.spec_root ⇒ Object
31
32
33
|
# File 'lib/matcha.rb', line 31
def spec_root
File.join(Rails.root, config.spec_dir)
end
|