Sha256: a95e36f678d660112b6d1513f747ea2625748289f18b14e031574ebe31c2d754

Contents?: true

Size: 1.28 KB

Versions: 65

Compression:

Stored size: 1.28 KB

Contents

$TESTING=true

require 'simplecov'
SimpleCov.start do
  add_group 'Libraries', 'lib'
  add_group 'Specs', 'spec'
end

$:.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", "task.thor")
load File.join(File.dirname(__FILE__), "fixtures", "group.thor")
load File.join(File.dirname(__FILE__), "fixtures", "script.thor")
load File.join(File.dirname(__FILE__), "fixtures", "invoke.thor")

RSpec.configure do |config|
  config.before do
    ARGV.replace []
  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

65 entries across 62 versions & 7 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.7.4 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.7.3 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.7.2 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.7.1 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.7.0 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.9 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/thor-0.15.4/spec/spec_helper.rb
challah-rolls-0.2.0 vendor/bundle/gems/thor-0.15.4/spec/spec_helper.rb
classiccms-0.6.8 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.7 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.6 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.5 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.4 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.3 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.2 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.1 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.6.0 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.5.17 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb
classiccms-0.5.16 vendor/bundle/gems/thor-0.15.2/spec/spec_helper.rb