Module: Konacha
- Defined in:
- lib/konacha/reporter.rb,
lib/konacha.rb,
lib/konacha/engine.rb,
lib/konacha/runner.rb,
lib/konacha/server.rb,
lib/konacha/formatter.rb,
app/models/konacha/spec.rb,
lib/konacha/reporter/example.rb,
lib/konacha/reporter/metadata.rb,
lib/konacha/reporter/example_group.rb,
app/controllers/konacha/specs_controller.rb
Overview
The ExampleGroup class mimics the public interface of RSpec::Core::ExampleGroup.
Defined Under Namespace
Classes: Engine, Formatter, Reporter, Runner, Server, Spec, SpecsController
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.mode ⇒ Object
Returns the value of attribute mode.
10
11
12
|
# File 'lib/konacha.rb', line 10
def mode
@mode
end
|
Class Method Details
.config ⇒ Object
24
25
26
|
# File 'lib/konacha.rb', line 24
def config
Konacha::Engine.config.konacha
end
|
28
29
30
|
# File 'lib/konacha.rb', line 28
def configure
yield config
end
|
.run ⇒ Object
19
20
21
22
|
# File 'lib/konacha.rb', line 19
def run
self.mode = :runner
Konacha::Runner.start
end
|
.serve ⇒ Object
12
13
14
15
16
17
|
# File 'lib/konacha.rb', line 12
def serve
puts "Your tests are here:"
puts " http://localhost:#{port}/"
self.mode = :server
Konacha::Server.start
end
|
.spec_paths ⇒ Object
38
39
40
41
42
43
44
45
46
|
# File 'lib/konacha.rb', line 38
def spec_paths
Rails.application.assets.each_entry(spec_root).find_all { |pathname|
config.spec_matcher === pathname.basename.to_s &&
(pathname.extname == '.js' || Tilt[pathname]) &&
Rails.application.assets.content_type_of(pathname) == 'application/javascript'
}.map { |pathname|
pathname.to_s.gsub(File.join(spec_root, ''), '')
}.sort
end
|
.spec_root ⇒ Object
34
35
36
|
# File 'lib/konacha.rb', line 34
def spec_root
File.join(Rails.root, config.spec_dir)
end
|