Class: Guard::Busted

Inherits:
Plugin
  • Object
show all
Includes:
BustedUtils
Defined in:
lib/guard/busted.rb

Overview

Plugin for ‘guard’ which starts ‘busted’ (lua unit testing framework) if a change is detected.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BustedUtils

#which

Constructor Details

#initialize(options = {}) ⇒ Busted

Initializes a Guard plugin.



17
18
19
20
21
22
# File 'lib/guard/busted.rb', line 17

def initialize(options = {})
  super

  @options = Guard::BustedOptions::DEFAULTS.merge(options)
  @runner = Guard::BustedRunner.new(@options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'lib/guard/busted.rb', line 14

def options
  @options
end

#runnerObject (readonly)

Returns the value of attribute runner.



14
15
16
# File 'lib/guard/busted.rb', line 14

def runner
  @runner
end

Instance Method Details

#run_allObject

Called when just ‘enter` is pressed



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

def run_all
  @runner.run_all
end

#run_on_modifications(paths) ⇒ Object

Called on file(s) modifications that the Guard plugin watches.



36
37
38
# File 'lib/guard/busted.rb', line 36

def run_on_modifications(paths)
  @runner.run(paths)
end

#startObject

Called once when Guard starts.



25
26
27
28
# File 'lib/guard/busted.rb', line 25

def start
  check_if_busted_exist
  run_all if @options[:run_all_on_start]
end