Class: Cardio::Command::RspecCommand

Inherits:
CommandBase show all
Defined in:
card/lib/cardio/command/rspec_command.rb,
card/lib/cardio/command/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 CommandBase

#exit_with_child_status, #run, #split_args

Constructor Details

#initialize(args) ⇒ RspecCommand

Returns a new instance of RspecCommand.



8
9
10
11
12
13
14
# File 'card/lib/cardio/command/rspec_command.rb', line 8

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



16
17
18
19
20
# File 'card/lib/cardio/command/rspec_command.rb', line 16

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