spec/keychain_spec.rb in ruby-keychain-0.1.1 vs spec/keychain_spec.rb in ruby-keychain-0.1.2
- old
+ new
@@ -24,10 +24,14 @@
describe 'open' do
it 'should create a keychain reference to a path' do
keychain = Keychain.open(File.join(ENV['HOME'], 'Library','Keychains', 'login.keychain'))
keychain.path.should == Keychain.default.path
end
+
+ it 'should raise when passed a nil path' do
+ expect {Keychain.open(nil)}.to raise_error(ArgumentError)
+ end
end
describe 'create' do
it 'should create the keychain' do
begin
@@ -104,13 +108,12 @@
end
shared_examples_for 'item collection' do
before(:each) do
- @keychain_1 = Keychain.create(File.join(Dir.tmpdir, "other_keychain_spec_#{Time.now.to_i}_#{Time.now.usec}_#{rand(1000)}.keychain"), 'pass')
- @keychain_2 = Keychain.create(File.join(Dir.tmpdir, "keychain_2_#{Time.now.to_i}_#{Time.now.usec}_#{rand(1000)}.keychain"), 'pass')
- @keychain_3 = Keychain.create(File.join(Dir.tmpdir, "keychain_3_#{Time.now.to_i}_#{Time.now.usec}_#{rand(1000)}.keychain"), 'pass')
-
+ @keychain_1 = Keychain.create(File.join(Dir.tmpdir, "other_keychain_spec_#{Time.now.to_i}_#{Time.now.usec}_#{rand(1000)}.keychain"), 'pass').add_to_search_list
+ @keychain_2 = Keychain.create(File.join(Dir.tmpdir, "keychain_2_#{Time.now.to_i}_#{Time.now.usec}_#{rand(1000)}.keychain"), 'pass').add_to_search_list
+ @keychain_3 = Keychain.create(File.join(Dir.tmpdir, "keychain_3_#{Time.now.to_i}_#{Time.now.usec}_#{rand(1000)}.keychain"), 'pass').add_to_search_list
add_fixtures
end
after(:each) do
@keychain_1.delete
\ No newline at end of file