Sha256: c8b01ff9c6b32c2fd4d09bdb0c772318e38e6f00bfbbb67b50b130a8f2765afa

Contents?: true

Size: 1.86 KB

Versions: 44

Compression:

Stored size: 1.86 KB

Contents

$TESTING = true

require "simplecov"
require "coveralls"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]

SimpleCov.start do
  add_filter "/spec/"
  minimum_coverage(92.21)
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "thor"
require "thor/group"
require "stringio"

require "rdoc"
require "rspec"
require "diff/lcs" # You need diff/lcs installed to run specs (but not to run Thor).
require "fakeweb"  # You need fakeweb installed to run specs (but not to run Thor).

# Set shell to basic
$0 = "thor"
$thor_runner = true
ARGV.clear
Thor::Base.shell = Thor::Shell::Basic

# Load fixtures
load File.join(File.dirname(__FILE__), "fixtures", "enum.thor")
load File.join(File.dirname(__FILE__), "fixtures", "group.thor")
load File.join(File.dirname(__FILE__), "fixtures", "invoke.thor")
load File.join(File.dirname(__FILE__), "fixtures", "script.thor")
load File.join(File.dirname(__FILE__), "fixtures", "subcommand.thor")
load File.join(File.dirname(__FILE__), "fixtures", "command.thor")

RSpec.configure do |config|
  config.before do
    ARGV.replace []
  end

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
  end

  def source_root
    File.join(File.dirname(__FILE__), "fixtures")
  end

  def destination_root
    File.join(File.dirname(__FILE__), "sandbox")
  end

  # This code was adapted from Ruby on Rails, available under MIT-LICENSE
  # Copyright (c) 2004-2013 David Heinemeier Hansson
  def silence_warnings
    old_verbose, $VERBOSE = $VERBOSE, nil
    yield
  ensure
    $VERBOSE = old_verbose
  end

  alias silence capture
end

Version data entries

44 entries across 41 versions & 19 rubygems

Version Path
abaci-0.3.0 vendor/bundle/gems/thor-0.19.1/spec/helper.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/spec/helper.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.8 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
tdiary-5.0.2 vendor/bundle/gems/thor-0.19.1/spec/helper.rb
tdiary-5.0.1 vendor/bundle/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.7 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.6 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.5 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.4 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.3 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.2 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.1 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
cvss-suite-1.0.0 vendor/cache/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/thor-0.19.1/spec/helper.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/thor-0.19.1/spec/helper.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/thor-0.19.1/spec/helper.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/thor-0.19.1/spec/helper.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/thor-0.19.1/spec/helper.rb