Sha256: b392c8d2d2647922b03a81219c7c7bfb0b3825f0e0f58705a7e0059574937c59

Contents?: true

Size: 782 Bytes

Versions: 11

Compression:

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

  initialize(: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

11 entries across 11 versions & 1 rubygems

Version Path
surrounded-0.8.3 test/test_helper.rb
surrounded-0.8.2 test/test_helper.rb
surrounded-0.8.1 test/test_helper.rb
surrounded-0.8.0 test/test_helper.rb
surrounded-0.7.3 test/test_helper.rb
surrounded-0.7.2 test/test_helper.rb
surrounded-0.7.1 test/test_helper.rb
surrounded-0.7.0 test/test_helper.rb
surrounded-0.6.0 test/test_helper.rb
surrounded-0.5.1 test/test_helper.rb
surrounded-0.5.0 test/test_helper.rb