test/unit/logging_tests.rb in deas-0.6.0 vs test/unit/logging_tests.rb in deas-0.7.0

- old
+ new

@@ -1,22 +1,26 @@ require 'assert' +require 'test/support/fake_app' require 'deas/logging' module Deas::Logging class BaseTests < Assert::Context desc "Deas::Logging" + setup do + @app = FakeApp.new + end subject{ Deas::Logging } should have_imeths :middleware end - class VerboseLoggingTests < Assert::Context + class VerboseLoggingTests < BaseTests desc "Deas::VerboseLogging" setup do - @middleware = Deas::VerboseLogging.new('a rack app goes here') + @middleware = Deas::VerboseLogging.new(@app) end subject{ @middleware } should have_imeths :call, :call! @@ -24,14 +28,14 @@ assert_kind_of Deas::BaseLogging, subject end end - class SummaryLoggingTests < Assert::Context + class SummaryLoggingTests < BaseTests desc "Deas::SummaryLogging" setup do - @middleware = Deas::SummaryLogging.new('a rack app goes here') + @middleware = Deas::SummaryLogging.new(@app) end subject{ @middleware } should have_imeths :call, :call! @@ -39,10 +43,10 @@ assert_kind_of Deas::BaseLogging, subject end end - class SummaryLineTests < Assert::Context + class SummaryLineTests < BaseTests desc "Deas::SummaryLine" subject{ Deas::SummaryLine } should "output its attributes in a specific order" do assert_equal %w{time status method path handler params}, subject.keys