Sha256: 3fce94cdd51eea3c95c406e259fbddd8f6e8e5afa90fdb44233655203302fe10
Contents?: true
Size: 1.05 KB
Versions: 21
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
21 entries across 21 versions & 1 rubygems