Sha256: 75ee4867778cb538c2bd2f94b99caa80ec33433365a6d09b94c5be73bdb876d9

Contents?: true

Size: 1.39 KB

Versions: 18

Compression:

Stored size: 1.39 KB

Contents

require 'rubygems'
require 'bundler'
require 'spork'
require 'vcr'

Spork.prefork do
  require 'rspec'
  require 'simplecov'
  require 'pp'
  
  APP_ROOT = File.expand_path('../../', __FILE__)
  
  Dir[File.join(APP_ROOT, "spec/support/**/*.rb")].each {|f| require f}

  VCR.configure do |c|
    c.cassette_library_dir = File.join(File.dirname(__FILE__), 'fixtures', 'vcr_cassettes')
    c.hook_into :webmock
  end

  RSpec.configure do |config|
    config.mock_with :rspec
    config.treat_symbols_as_metadata_keys_with_true_values = true
    config.filter_run :focus => true
    config.run_all_when_everything_filtered = true

    config.around do |example|
      # Dynamically create cassettes based on the name of the example
      # being run. This creates a new cassette for every test.
      cur = example.metadata
      identifiers = [example.metadata[:description_args]]
      while cur = cur[:example_group] do
        identifiers << cur[:description_args]
      end

      VCR.use_cassette(identifiers.reverse.join(' ')) do
        example.run
      end
    end
  end

  SimpleCov.start do
    add_filter 'spec/'
  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

end

Spork.each_run do
  require 'thor-scmversion'
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
thor-scmversion-1.7.0 spec/spec_helper.rb
thor-scmversion-1.6.0 spec/spec_helper.rb
thor-scmversion-1.4.0 spec/spec_helper.rb
thor-scmversion-1.2.1 spec/spec_helper.rb
thor-scmversion-1.1.0 spec/spec_helper.rb
thor-scmversion-1.0.1 spec/spec_helper.rb
thor-scmversion-1.0.0 spec/spec_helper.rb
thor-scmversion-0.3.1 spec/spec_helper.rb
thor-scmversion-0.2.4 spec/spec_helper.rb
thor-scmversion-0.2.3 spec/spec_helper.rb
thor-scmversion-0.2.2 spec/spec_helper.rb
thor-scmversion-0.2.1 spec/spec_helper.rb
thor-scmversion-0.2.0 spec/spec_helper.rb
thor-scmversion-0.0.5 spec/spec_helper.rb
thor-scmversion-0.0.4 spec/spec_helper.rb
thor-scmversion-0.0.3 spec/spec_helper.rb
thor-scmversion-0.0.2 spec/spec_helper.rb
thor-scmversion-0.0.1 spec/spec_helper.rb