Sha256: 61a76b5e03e2c343695a29a62f5007a077a2023f33f2184ef7f2ff6b119b8101

Contents?: true

Size: 738 Bytes

Versions: 7

Compression:

Stored size: 738 Bytes

Contents

# encoding: utf-8

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

  include Nanoc3::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
    Nanoc3::CLI::ErrorHandler.new
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nanoc3-3.2.4 test/cli/test_error_handler.rb
nanoc3-3.2.3 test/cli/test_error_handler.rb
nanoc3-3.2.2 test/cli/test_error_handler.rb
nanoc3-3.2.1 test/cli/test_error_handler.rb
nanoc3-3.2.0 test/cli/test_error_handler.rb
nanoc3-3.2.0b3 test/cli/test_error_handler.rb
nanoc3-3.2.0b2 test/cli/test_error_handler.rb