Sha256: 8dd0e64a487c786a70906492e37b8f7acf7dcaf13c178f29e5fb23c13094e9ac

Contents?: true

Size: 735 Bytes

Versions: 11

Compression:

Stored size: 735 Bytes

Contents

# encoding: utf-8

class Nanoc::CLI::ErrorHandlerTest < MiniTest::Unit::TestCase

  include Nanoc::TestHelpers

  def test_resolution_for_with_unknown_gem
    error = LoadError.new('no such file to load -- afjlrestjlsgrshter')
    assert_nil handler.send(:resolution_for, error)
  end

  def test_resolution_for_with_known_gem
    $loud = true
    error = LoadError.new('no such file to load -- kramdown')
    assert_match /^Try installing /, handler.send(:resolution_for, error)
  ensure
    $loud = false
  end

  def test_resolution_for_with_not_load_error
    error = RuntimeError.new('nuclear meltdown detected')
    assert_nil handler.send(:resolution_for, error)
  end

  def handler
    Nanoc::CLI::ErrorHandler.new
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nanoc-3.4.2 test/cli/test_error_handler.rb
nanoc-3.4.1 test/cli/test_error_handler.rb
nanoc-3.4.0 test/cli/test_error_handler.rb
nanoc-3.3.7 test/cli/test_error_handler.rb
nanoc-3.3.6 test/cli/test_error_handler.rb
nanoc-3.3.5 test/cli/test_error_handler.rb
nanoc-3.3.4 test/cli/test_error_handler.rb
nanoc-3.3.3 test/cli/test_error_handler.rb
nanoc-3.3.2 test/cli/test_error_handler.rb
nanoc-3.3.1 test/cli/test_error_handler.rb
nanoc-3.3.0 test/cli/test_error_handler.rb