Sha256: 492b6228b3f60aab1e8596eb0413ea23704626c4a2029680e0f564a26355a449
Contents?: true
Size: 1.05 KB
Versions: 26
Compression:
Stored size: 1.05 KB
Contents
#!/usr/bin/env ruby require 'rake' require 'rake/tasklib' require 'guard/jasmine/cli' module Guard # Provides a method to define a Rake task that # runs the Jasmine specs. # class JasmineTask < ::Rake::TaskLib # Name of the main, top level task attr_accessor :name # CLI options attr_accessor :options # Initialize the Rake task # # @param [Symbol] name the name of the Rake task # @param [String] options the CLI options # @yield [JasmineTask] the task # def initialize(name = :jasmine, options = '') @name = name @options = options yield self if block_given? namespace :guard do desc 'Run all Jasmine specs' task(name) do begin ::Guard::Jasmine::CLI.start(self.options.split) rescue SystemExit => e case e.status when 1 fail 'Some specs have failed' when 2 fail "The spec couldn't be run: #{ e.message }'" end end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems