Class: TC_KeyingAlgorithms

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb

Defined Under Namespace

Classes: MockRegistry

Instance Method Summary collapse

Instance Method Details

#setupObject



14
15
16
17
18
# File 'lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb', line 14

def setup
  @algorithms = KeyingAlgorithms.new
  @algorithms.algorithms = { "mock" => "something.mock" }
  @algorithms.registry = MockRegistry.new
end

#test_get_foundObject



26
27
28
29
# File 'lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb', line 26

def test_get_found
  svc = @algorithms.get( "mock" )
  assert_equal svc, "found"
end

#test_get_not_foundObject



20
21
22
23
24
# File 'lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb', line 20

def test_get_not_found
  assert_raise( RuntimeError ) do
    @algorithms.get( "bogus" )
  end
end