class Guard::Busted

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

Attributes

options[R]
runner[R]

Public Class Methods

new(options = {}) click to toggle source

Initializes a Guard plugin.

Calls superclass method
# File lib/guard/busted.rb, line 16
def initialize(options = {})
  super

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

Public Instance Methods

run_all() click to toggle source

Called when just `enter` is pressed

# File lib/guard/busted.rb, line 30
def run_all
  @runner.run_all
end
run_on_modifications(paths) click to toggle source

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

# File lib/guard/busted.rb, line 35
def run_on_modifications(paths)
  @runner.run(paths)
end
start() click to toggle source

Called once when Guard starts.

# File lib/guard/busted.rb, line 24
def start
  check_if_busted_exist
  run_all if @options[:run_all_on_start]
end

Private Instance Methods

check_if_busted_exist() click to toggle source
# File lib/guard/busted.rb, line 41
def check_if_busted_exist
  return unless which('busted').nil?

  puts 'Busted not found. Use :cmd option or ' \
       'install `busted` via `luarocks install busted --local`'
end