Class: CitizenCodeScripts::Rspec

Inherits:
Base
  • Object
show all
Defined in:
lib/citizen_code_scripts/rspec.rb

Constant Summary

Constants included from Colorize

Colorize::COLOR_CODES

Instance Attribute Summary

Attributes inherited from Base

#argv

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#app_names, #app_root, help, inherited, #initialize, load_scripts_deferred, name, run, script_classes, script_names, scripts, #staging_app_name, #step, #system!

Methods included from Colorize

#colorize, included

Constructor Details

This class inherits a constructor from CitizenCodeScripts::Base

Class Method Details

.descriptionObject



2
3
4
# File 'lib/citizen_code_scripts/rspec.rb', line 2

def self.description
  "Runs your RSpec suite"
end

Instance Method Details

#runObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/citizen_code_scripts/rspec.rb', line 6

def run
  begin
    load(File.expand_path("./spring", __FILE__))
  rescue LoadError
  end

  require 'bundler/setup'

  step "Running RSpec" do
    command = [Gem.bin_path('rspec-core', 'rspec')] + argv
    system!(command.join(" "))
  end
end