Sha256: 3b097fe47f976b01bcc1578c9a91a94de9f2909ee634907a58cb38cf4116a600

Contents?: true

Size: 1.56 KB

Versions: 77

Compression:

Stored size: 1.56 KB

Contents

$TESTING=true

require 'simplecov'
require 'coveralls'

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

$:.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

  alias :silence :capture
end

Version data entries

77 entries across 69 versions & 15 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.9.0 vendor/bundle/ruby/2.7.0/gems/thor-0.18.1/spec/helper.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.8.0 vendor/bundle/ruby/2.7.0/gems/thor-0.18.1/spec/helper.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.7.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.6.2 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.6.1 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.6.0 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.5.0 vendor/bundle/ruby/2.5.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.5.0/gems/thor-0.18.1/spec/helper.rb
vagrant-unbundled-2.2.4.0 vendor/bundle/ruby/2.6.0/gems/thor-0.18.1/spec/helper.rb