Sha256: 3ad8e07999df92d18c70c112c77b69582ab94affbc12f3442b452ce7651d8bdb

Contents?: true

Size: 322 Bytes

Versions: 9

Compression:

Stored size: 322 Bytes

Contents

require 'stringio'

module <%= app_name.camelize %>
  module Helper
    module Assertions
      def capture_stdout(&block)
        old_stdout = $stdout
        fake       = StringIO.new
        $stdout    = fake

        block.call
        fake.string
      ensure
        $stdout = old_stdout
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rgentpl-1.0.9 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.8 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.7 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.6 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.5 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.4 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.3 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.2 src/spec/support/helper/assertions.rb.tt
rgentpl-1.0.1 src/spec/support/helper/assertions.rb.tt