Class: Cardio::Command::RspecCommand

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



7
8
9
10
11
12
13
# File 'lib/cardio/command/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
19
# File 'lib/cardio/command/rspec_command.rb', line 15

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