Class: KeyHolderTest
- Defined in:
- lib/extensions/ezcrypto/ext/test/key_holder_test.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key_holder ⇒ Object
readonly
Returns the value of attribute key_holder.
Instance Method Summary collapse
- #setup ⇒ Object
- #test_enter_password_should_set_session_key ⇒ Object
- #test_session_key_should_not_be_set_on_new ⇒ Object
- #test_set_encoded_key_should_set_session_key ⇒ Object
- #test_set_session_key_should_set_session_key ⇒ Object
Instance Attribute Details
#key_holder ⇒ Object (readonly)
Returns the value of attribute key_holder.
11 12 13 |
# File 'lib/extensions/ezcrypto/ext/test/key_holder_test.rb', line 11 def key_holder @key_holder end |
Instance Method Details
#setup ⇒ Object
13 14 15 |
# File 'lib/extensions/ezcrypto/ext/test/key_holder_test.rb', line 13 def setup @key_holder=KeyHolderSubject.new end |
#test_enter_password_should_set_session_key ⇒ Object
35 36 37 38 39 40 |
# File 'lib/extensions/ezcrypto/ext/test/key_holder_test.rb', line 35 def test_enter_password_should_set_session_key key=EzCrypto::Key.with_password "test","onetwothree" key_holder.enter_password "test" assert_not_nil key_holder.session_key assert_equal key.raw,key_holder.session_key.raw end |
#test_session_key_should_not_be_set_on_new ⇒ Object
17 18 19 |
# File 'lib/extensions/ezcrypto/ext/test/key_holder_test.rb', line 17 def test_session_key_should_not_be_set_on_new assert_nil key_holder.session_key end |
#test_set_encoded_key_should_set_session_key ⇒ Object
28 29 30 31 32 33 |
# File 'lib/extensions/ezcrypto/ext/test/key_holder_test.rb', line 28 def test_set_encoded_key_should_set_session_key key=EzCrypto::Key.generate key_holder.set_encoded_key key.encode assert_not_nil key_holder.session_key assert_equal key.raw,key_holder.session_key.raw end |
#test_set_session_key_should_set_session_key ⇒ Object
21 22 23 24 25 26 |
# File 'lib/extensions/ezcrypto/ext/test/key_holder_test.rb', line 21 def test_set_session_key_should_set_session_key key=EzCrypto::Key.generate key_holder.set_session_key key assert_not_nil key_holder.session_key assert_equal key.raw,key_holder.session_key.raw end |