Require External Resources

Definition:

  • Test require external resources but can not guarantee their state and availability

Code Example:

class Clever
  def districts
    url = "/districts"
    key = "DEMO_KEY"
    `curl -u #{key}: #{host}#{url}`
  end
end

class External < Test::Unit::TestCase
  def test_get_clever_data
    c = Clever.new
    assert_include c.districts, 'Demo'
  end
end

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring