Sha256: 0e144bf922d8aa2f7fec286306f4ce6924e8f77ee1a6b36acb35f3215f005d40

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 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'}.should raise_error
  end

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

  it "should make plugin raise errors" do
    proc{app.plugin Module.new}.should raise_error
  end

  it "should make subclassing raise errors" do
    proc{Class.new(app)}.should raise_error
  end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
roda-2.2.0 spec/freeze_spec.rb
roda-2.1.0 spec/freeze_spec.rb
roda-2.0.0 spec/freeze_spec.rb
roda-1.3.0 spec/freeze_spec.rb