ezmobius / nanite

self assembling fabric of ruby daemons

This URL has Read+Write access

nanite / spec / encrypted_document_spec.rb
100644 22 lines (15 sloc) 0.465 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require File.join(File.dirname(__FILE__), 'spec_helper')
 
describe Nanite::EncryptedDocument do
  
  include SpecHelpers
 
  before(:all) do
    @test_data = "Test Data to Sign"
    @cert, @key = issue_cert
    @doc = Nanite::EncryptedDocument.new(@test_data, @cert)
  end
 
  it 'should create encrypted data' do
    @doc.encrypted_data.should_not be_nil
  end
 
  it 'should decrypt correctly' do
    @doc.decrypted_data(@key, @cert).should == @test_data
  end
 
end