Class: Guard::Codeception
- Inherits:
-
Plugin
- Object
- Plugin
- Guard::Codeception
- Defined in:
- lib/guard/codeception.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :test_on_start => false, :suites => [:acceptance, :functional, :unit], :debug => false, :groups => [] }
Instance Method Summary collapse
- #execute(cmd) ⇒ Object
-
#initialize(options = {}) ⇒ Codeception
constructor
A new instance of Codeception.
- #make(cmd_parts) ⇒ Object
- #run ⇒ Object
- #run_on_change(paths) ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Codeception
Returns a new instance of Codeception.
14 15 16 17 |
# File 'lib/guard/codeception.rb', line 14 def initialize( = {}) @options = DEFAULT_OPTIONS.merge() super(@options) end |
Instance Method Details
#execute(cmd) ⇒ Object
43 44 45 |
# File 'lib/guard/codeception.rb', line 43 def execute(cmd) system cmd end |
#make(cmd_parts) ⇒ Object
39 40 41 |
# File 'lib/guard/codeception.rb', line 39 def make(cmd_parts) cmd_parts.join ' ' end |
#run ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/guard/codeception.rb', line 27 def run cmd = [] cmd << "vendor/bin/codecept" cmd << "run" cmd << [:suites].join(',') cmd << '-g ' + [:groups].join(' -g ') if ![:groups].empty? cmd << '--debug' if [:debug] status = execute make(cmd) status end |
#run_on_change(paths) ⇒ Object
23 24 25 |
# File 'lib/guard/codeception.rb', line 23 def run_on_change(paths) puts run end |
#start ⇒ Object
19 20 21 |
# File 'lib/guard/codeception.rb', line 19 def start puts run if [:test_on_start] end |