Sha256: 8cd14da12eb83cc171124e8d8d2866a1f6ac709ab0bb3106bf77388ef02c19a6

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

require 'simplecov'
require 'minitest/autorun'
SimpleCov.enable_coverage :branch
SimpleCov.add_filter %r{version.rb}
SimpleCov.start unless defined?(Coverage)

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

  def block_method(*args, &block)
    block.call(*args, self)
  end
  trigger :block_method

  def regular_method_trigger
    true
  end
  trigger :regular_method_trigger
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
surrounded-1.1.0 test/test_helper.rb