Sha256: 1a2b2e97cec48c1ff4202721685a5100235471a047d21e110c01dd202874ed74

Contents?: true

Size: 607 Bytes

Versions: 1

Compression:

Stored size: 607 Bytes

Contents

class SpecPerimeter < Kindergarten::Perimeter
  purpose :testing

  governess Kindergarten::StrictGoverness

  govern do
    can :view, String
  end

  # should pass and return the child
  def sandboxed
    guard(:view, child)
  end

  # should raise AccessDenied
  def guarded
    guard(:somethings, child)
  end

  # should not be accessible
  def unboxed
    $stderr.puts "I should never happen"
  end

  # should return "OK"
  def not_guarded
    unguarded
    "OK"
  end

  # should raise Unguarded
  def unsafe
    return child.reverse
  end

  sandbox :sandboxed, :not_guarded, :guarded, :unsafe
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kindergarten-0.1.0 spec/support/spec_perimeter.rb