Sha256: 1e5b8ff18e463e5d83e9a8e7a77c294ec1e86ab11914f4b7793d73d9f932aad6

Contents?: true

Size: 695 Bytes

Versions: 1

Compression:

Stored size: 695 Bytes

Contents

require File.expand_path("spec_helper", File.dirname(__FILE__))

describe "Roda.freeze" do
  before do
    app{}.freeze
  end

  it "should make opts not be modifiable after calling finalize!" do
    proc{app.opts[:foo] = 'bar'}.must_raise FrozenError
  end

  it "should make use and route raise errors" do
    proc{app.use Class.new}.must_raise FrozenError
    proc{app.route{}}.must_raise FrozenError
  end

  it "should make plugin raise errors" do
    proc{app.plugin Module.new}.must_raise Roda::RodaError
  end

  it "should make subclassing raise errors" do
    proc{Class.new(app)}.must_raise Roda::RodaError
  end

  it "should freeze app" do
    app.frozen?.must_equal true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roda-2.3.0 spec/freeze_spec.rb