spec/plugin/hooks_spec.rb in roda-2.2.0 vs spec/plugin/hooks_spec.rb in roda-2.3.0

- old
+ new

@@ -27,23 +27,23 @@ end end it "adds before and after hooks for running code before and after requests" do s, h, b = req - s.should == 201 - h['foo'].should == 'baz' - b.join.should == 'bar' - @a.should == [[200, 'baz', ['bar']]] + s.must_equal 201 + h['foo'].must_equal 'baz' + b.join.must_equal 'bar' + @a.must_equal [[200, 'baz', ['bar']]] end it "multiple plugin calls do not override existing hooks" do app.plugin :hooks s, h, b = req - s.should == 201 - h['foo'].should == 'baz' - b.join.should == 'bar' - @a.should == [[200, 'baz', ['bar']]] + s.must_equal 201 + h['foo'].must_equal 'baz' + b.join.must_equal 'bar' + @a.must_equal [[200, 'baz', ['bar']]] end it "after hooks are still called if an exception is raised" do a = @a @app.before do @@ -53,13 +53,13 @@ @app.after do |r| a << r a << $! end - proc{req}.should raise_error(Roda::RodaError) - a.pop.should be_a_kind_of(Roda::RodaError) - a.pop.should == nil + proc{req}.must_raise(Roda::RodaError) + a.pop.must_be_kind_of(Roda::RodaError) + a.pop.must_equal nil end it "handles multiple before and after blocks correctly" do a = @a @app.before do @@ -70,26 +70,26 @@ a << r[1]['bar'] r[0] *= 2 end s, h, b = req - s.should == 402 - h['foo'].should == 'baz' - h['bar'].should == 'foo' - b.join.should == 'bar' - a.should == [[200, 'baz', ['bar']], 'foo'] + s.must_equal 402 + h['foo'].must_equal 'baz' + h['bar'].must_equal 'foo' + b.join.must_equal 'bar' + a.must_equal [[200, 'baz', ['bar']], 'foo'] end it "copies before and after blocks when subclassing" do @app = Class.new(@app) @app.route do |r| r.on do "foo" end end s, h, b = req - s.should == 201 - h['foo'].should == 'bar' - b.join.should == 'foo' - @a.should == [[200, 'bar', ['foo']]] + s.must_equal 201 + h['foo'].must_equal 'bar' + b.join.must_equal 'foo' + @a.must_equal [[200, 'bar', ['foo']]] end end