Sha256: 477a0a8c8f46a082e92cab855e3deb892936ae2f1b2f05e17b0bf775c2d4a992

Contents?: true

Size: 777 Bytes

Versions: 2

Compression:

Stored size: 777 Bytes

Contents

require 'simplecov'
require 'minitest/autorun'
require 'coveralls'

if ENV['COVERALLS']
  Coveralls.wear!
end

require 'surrounded'
require 'surrounded/context'

class User
  include Surrounded
  def initialize(name)
    @name = name
  end
  attr_reader :name
end

class TestContext
  extend Surrounded::Context

  setup(:user, :other_user)

  trigger :access_other_object do
    user.other_user.name
  end
end

# This is a different implementation of module_method_rebinding?
# created in order to check that the behavior of the code is correct.
#
# This method is used in tests and module_method_rebinding? is used
# in the library code.
def test_rebinding_methods?
  unbound = Enumerable.instance_method(:count)
  unbound.bind(Object.new)
  true
rescue TypeError
  false
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
surrounded-0.4.1 test/test_helper.rb
surrounded-0.4.0 test/test_helper.rb