class Wagn::Commands::RspecCommand

Public Class Methods

new(args) click to toggle source
# File lib/wagn/commands/rspec_command.rb, line 6
def initialize args
  require "rspec/core"
  require "wagn/application"

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

Public Instance Methods

command() click to toggle source
# File lib/wagn/commands/rspec_command.rb, line 15
def command
  "#{env_args} #{@opts[:executer]} " \
    " #{@opts[:rescue]} rspec #{@rspec_args.shelljoin} #{@opts[:files]} "\
    " --exclude-pattern \"./card/vendor/**/*\""
end

Private Instance Methods

coverage() click to toggle source
# File lib/wagn/commands/rspec_command.rb, line 27
def coverage
  # no coverage if rspec was started with file argument
  if (@opts[:files] || @rspec_args.present?) && !@opts[:simplecov]
    @opts[:simplecov] = "COVERAGE=false"
  end
  @opts[:simplecov]
end
env_args() click to toggle source
# File lib/wagn/commands/rspec_command.rb, line 23
def env_args
  ["RAILS_ROOT=.", coverage].compact.join " "
end