Class: Cardio::Commands::RspecCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/cardio/commands/rspec_command.rb,
lib/cardio/commands/rspec_command/parser.rb

Overview

enhance standard RSpec command with some decko/card -specific options

Defined Under Namespace

Classes: Parser

Instance Method Summary collapse

Methods inherited from Command

#exit_with_child_status, #run, #split_args

Constructor Details

#initialize(args) ⇒ RspecCommand

Returns a new instance of RspecCommand.



7
8
9
10
11
12
13
# File 'lib/cardio/commands/rspec_command.rb', line 7

def initialize args
  require "rspec/core"

  cardio_args, @rspec_args = split_args args
  @opts = {}
  Parser.new(@opts).parse!(cardio_args)
end

Instance Method Details

#commandObject



15
16
17
18
# File 'lib/cardio/commands/rspec_command.rb', line 15

def command
  "#{env_args} #{@opts[:executer]} #{@opts[:rescue]}" \
    "rspec #{@rspec_args.shelljoin} #{@opts[:files]}"
end