Sha256: 64fef022d365ac47e6565fc94487fea8b86592c89a462b6e7899e8820a3e9d18

Contents?: true

Size: 489 Bytes

Versions: 16

Compression:

Stored size: 489 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

end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
opal-rspec-0.6.2 rspec-core/spec/support/helper_methods.rb
opal-rspec-0.6.1 rspec-core/spec/support/helper_methods.rb
opal-rspec-0.6.0 rspec-core/spec/support/helper_methods.rb
opal-rspec-0.6.0.beta1 rspec-core/spec/support/helper_methods.rb
opal-connect-rspec-0.5.0 rspec-core/spec/support/helper_methods.rb
opal-rspec-0.5.0 rspec-core/spec/support/helper_methods.rb
opal-rspec-0.5.0.beta3 rspec-core/spec/support/helper_methods.rb
opal-rspec-0.5.0.beta2 rspec-core/spec/support/helper_methods.rb
opal-rspec-0.5.0.beta1 rspec-core/spec/support/helper_methods.rb
rspec-core-3.0.0.beta2 spec/support/helper_methods.rb
rspec-core-3.0.0.beta1 spec/support/helper_methods.rb
rspec-core-2.14.3 spec/support/helper_methods.rb
rspec-core-2.14.2 spec/support/helper_methods.rb
rspec-core-2.14.1 spec/support/helper_methods.rb
rspec-core-2.14.0 spec/support/helper_methods.rb
rspec-core-2.14.0.rc1 spec/support/helper_methods.rb