Sha256: 16c6ab57669a593bf780293468284a7c541a8f63590b2584d2cd632781ee352b

Contents?: true

Size: 800 Bytes

Versions: 27

Compression:

Stored size: 800 Bytes

Contents

module RSpecHelpers
  def relative_path(path)
    RSpec::Core::Metadata.relative_path(path)
  end

  def ignoring_warnings
    original = $VERBOSE
    $VERBOSE = nil
    result = yield
    $VERBOSE = original
    result
  end

  def safely
    Thread.new do
      ignoring_warnings { $SAFE = 3 }
      yield
    end.join

    # $SAFE is not supported on Rubinius
    unless defined?(Rubinius)
      expect($SAFE).to eql 0 # $SAFE should not have changed in this thread.
    end
  end

  def expect_deprecation_with_call_site(file, line)
    expect(RSpec.configuration.reporter).to receive(:deprecation) do |options|
      expect(options[:call_site]).to include([file, line].join(':'))
    end
  end

  def allow_deprecation
    allow(RSpec.configuration.reporter).to receive(:deprecation)
  end

end

Version data entries

27 entries across 27 versions & 8 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-core-2.14.8/spec/support/helper_methods.rb
dxruby_rp5-0.0.4 spec/vendor/rspec-core-2.14.7/spec/support/helper_methods.rb
rspec-core-2.14.8 spec/support/helper_methods.rb
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-core-2.14.7/spec/support/helper_methods.rb
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-core-2.14.7/spec/support/helper_methods.rb
dxruby_rp5-0.0.3 spec/vendor/rspec-core-2.14.7/spec/support/helper_methods.rb
tuktuk-rails-0.0.10 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/spec/support/helper_methods.rb
tuktuk-rails-0.0.9 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/spec/support/helper_methods.rb
tuktuk-rails-0.0.8 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/spec/support/helper_methods.rb
tuktuk-rails-0.0.7 vendor/bundle/ruby/2.0.0/gems/rspec-core-2.14.7/spec/support/helper_methods.rb
dxruby_rp5-0.0.2 spec/vendor/rspec-core-2.14.7/spec/support/helper_methods.rb
dxruby_rp5-0.0.1 spec/vendor/rspec-core-2.14.7/spec/support/helper_methods.rb