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

.modeObject

Returns the value of attribute mode.



7
8
9
# File 'lib/matcha.rb', line 7

def mode
  @mode
end

Class Method Details

.configObject



21
22
23
# File 'lib/matcha.rb', line 21

def config
  Matcha::Engine.config.matcha
end

.configure {|config| ... } ⇒ Object

Yields:



25
26
27
# File 'lib/matcha.rb', line 25

def configure
  yield config
end

.runObject



16
17
18
19
# File 'lib/matcha.rb', line 16

def run
  self.mode = :runner
  Matcha::Runner.start
end

.serveObject



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_pathsObject



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_rootObject



31
32
33
# File 'lib/matcha.rb', line 31

def spec_root
  File.join(Rails.root, config.spec_dir)
end