Sha256: fe9f9f3282402d02d1e99a56db056b0b09e5ef9d15e7ee469851e11220d5b33b

Contents?: true

Size: 653 Bytes

Versions: 8

Compression:

Stored size: 653 Bytes

Contents

module AcceptanceTests
  module Matchers
    def have_output(output)
      HaveOutputMatcher.new(output)
    end

    class HaveOutputMatcher
      def initialize(output)
        @output = output
      end

      def matches?(runner)
        @runner = runner
        runner.has_output?(output)
      end

      def failure_message
        "Expected command to have output, but did not.\n\n" +
          "Command: #{runner.formatted_command}\n\n" +
          "Expected output:\n" +
          output.inspect + "\n\n" +
          "Actual output:\n" +
          runner.output
      end

      protected

      attr_reader :output, :runner
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
shoulda-matchers-3.1.3 spec/support/acceptance/matchers/have_output.rb
shoulda-matchers-4.0.0.rc1 spec/support/acceptance/matchers/have_output.rb
shoulda-3.6.0 test/support/acceptance/matchers/have_output.rb
shoulda-matchers-3.1.2 spec/support/acceptance/matchers/have_output.rb
shoulda-matchers-3.1.1 spec/support/acceptance/matchers/have_output.rb
shoulda-matchers-3.1.0 spec/support/acceptance/matchers/have_output.rb
shoulda-matchers-3.0.1 spec/support/acceptance/matchers/have_output.rb
shoulda-matchers-3.0.0 spec/support/acceptance/matchers/have_output.rb