Sha256: 427f0f49b908a4aabbe77205dc81f2ff9e29da26241a20ed4b55cc3c394f8129
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true require 'guard/compat/plugin' require 'guard/busted/options' require 'guard/busted/runner' require 'guard/busted/utils' module Guard # Plugin for 'guard' which starts 'busted' (lua unit testing framework) if a change is detected. class Busted < Plugin include BustedUtils attr_reader :options, :runner # Initializes a Guard plugin. def initialize(options = {}) super @options = Guard::BustedOptions::DEFAULTS.merge(options) @runner = Guard::BustedRunner.new(@options) end # Called once when Guard starts. def start check_if_busted_exist run_all if @options[:run_all_on_start] end # Called when just `enter` is pressed def run_all @runner.run_all end # Called on file(s) modifications that the Guard plugin watches. def run_on_modifications(paths) @runner.run(paths) end private def check_if_busted_exist return if which('busted').nil? puts 'Busted not found. Use :cmd option or ' \ 'install `busted` via `luarocks install busted --local`' end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
guard-busted-0.1.1 | lib/guard/busted.rb |