Sha256: bbbc2af00d20a139e7ff1abf775f716310d7e8500a460c410c4b616a67e401ce

Contents?: true

Size: 753 Bytes

Versions: 11

Compression:

Stored size: 753 Bytes

Contents

require "mireru/logger"
require "stringio"

class LoggerTest < Test::Unit::TestCase
  def setup
    @logger = Mireru::Logger.new
  end

  def test_info
    s = ""
    io = StringIO.new(s)
    $stdout = io
    message = <<-EOM
#{Mireru::Command::Mireru::USAGE}
  If no argument, then search current directory.
Keybind:
  n: next
  p: prev
  q: quit
    EOM
    @logger.info(message)
    $stdout = STDOUT
    assert_equal(message, s)
  end

  def test_error
    s = ""
    io = StringIO.new(s)
    $stderr = io
    message = <<-EOM
Warning: valid file not found.
#{Mireru::Command::Mireru::USAGE}
Support file types: png, gif, jpeg(jpg). The others are...yet.
    EOM
    @logger.error(message)
    $stderr = STDERR
    assert_equal(message, s)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mireru-0.2.0 test/test-logger.rb
mireru-0.1.9 test/test-logger.rb
mireru-0.1.8 test/test-logger.rb
mireru-0.1.7 test/test-logger.rb
mireru-0.1.6 test/test-logger.rb
mireru-0.1.5 test/test-logger.rb
mireru-0.1.4 test/test-logger.rb
mireru-0.1.3 test/test-logger.rb
mireru-0.1.2 test/test-logger.rb
mireru-0.1.1 test/test-logger.rb
mireru-0.1.0 test/test-logger.rb