Sha256: ff910307ad9043573f974388609299be9ba8f1f6871af7cbb7d1059a97352730

Contents?: true

Size: 640 Bytes

Versions: 3

Compression:

Stored size: 640 Bytes

Contents

$: << File.join( File.dirname( __FILE__ ), "..", "lib" )
require 'test/unit'
require 'cipher'

class TC_KeyingAlgorithms < Test::Unit::TestCase

  class MockRegistry
    def service( name )
      return "found" if name == "something.mock"
      return nil
    end
  end

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

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

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

end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
copland-0.8.0 examples/solitaire-cipher/test/tc_keying-algorithms.rb
copland-1.0.0 examples/solitaire-cipher/test/tc_keying-algorithms.rb
rubyzip-0.9.1 lib/quiz1/t/solutions/Jamis Buck/test/tc_keying-algorithms.rb