Sha256: ae80b04a96ee4fc33213d6624a8543b0bb451fe249ab334cb23d400acaa067f1

Contents?: true

Size: 467 Bytes

Versions: 10

Compression:

Stored size: 467 Bytes

Contents

require "boxes/testing/matchers/base_matcher"

module Boxes
  module Testing
    module Matchers
      class WriteToStdoutMatcher < BaseMatcher
        def failure_message
          "expected that '#{clean(actual.stdout)}' would be #{clean(expected)}"
        end

        private

        def match(actual, expected)
          expected == actual.stdout
        end

        def clean(output)
          output.gsub(/\n/, '\n')
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
boxes-3.7.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.6.1 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.6.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.5.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.4.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.3.1 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.3.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.2.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.1.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb
boxes-3.0.0 lib/boxes/testing/matchers/write_to_stdout_matcher.rb