Skip to content

Commit 04f6e97

Browse files
committed
Prepare tests
1 parent 6cc6a72 commit 04f6e97

File tree

7 files changed

+81
-2
lines changed

7 files changed

+81
-2
lines changed

Gemfile.lock

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
edb (0.2)
4+
edb (0.2.2)
55
aws-sdk (= 1.59.1)
66

77
GEM
@@ -12,16 +12,32 @@ GEM
1212
aws-sdk-v1 (1.59.1)
1313
json (~> 1.4)
1414
nokogiri (>= 1.4.4)
15+
diff-lcs (1.2.5)
1516
json (1.8.3)
1617
mini_portile (0.6.2)
1718
nokogiri (1.6.6.2)
1819
mini_portile (~> 0.6.0)
20+
rspec (3.3.0)
21+
rspec-core (~> 3.3.0)
22+
rspec-expectations (~> 3.3.0)
23+
rspec-mocks (~> 3.3.0)
24+
rspec-core (3.3.2)
25+
rspec-support (~> 3.3.0)
26+
rspec-expectations (3.3.1)
27+
diff-lcs (>= 1.2.0, < 2.0)
28+
rspec-support (~> 3.3.0)
29+
rspec-mocks (3.3.2)
30+
diff-lcs (>= 1.2.0, < 2.0)
31+
rspec-support (~> 3.3.0)
32+
rspec-support (3.3.0)
1933

2034
PLATFORMS
2135
ruby
2236

2337
DEPENDENCIES
38+
bundler (~> 1.10)
2439
edb!
40+
rspec (~> 3.3)
2541

2642
BUNDLED WITH
2743
1.10.4

Rakefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /usr/bin/env ruby
22
require 'rake'
33

4-
task default: [ :build, :install ]
4+
task default: [ :build, :install, :test ]
55

66
task :build do
77
sh 'gem build edb.gemspec'
@@ -10,3 +10,11 @@ end
1010
task :install do
1111
sh 'gem install *.gem'
1212
end
13+
14+
task :test do
15+
FileUtils.cd 'specs' do
16+
Dir['*_spec.rb'].each do |spec|
17+
sh "rspec #{spec} --backtrace --color --format doc"
18+
end
19+
end
20+
end

edb.gemspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ Gem::Specification.new { |s|
1616
s.require_paths = ['lib']
1717

1818
s.add_dependency 'aws-sdk', '1.59.1'
19+
20+
s.add_development_dependency 'rspec', '~> 3.3'
21+
s.add_development_dependency 'bundler', '~> 1.10'
1922
}

specs/cryptography_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require_relative 'spec_helper'
2+
3+
describe EDB::Cryptography do
4+
describe '#supports?' do
5+
context 'given algorithm is supported' do
6+
it 'returns true' do
7+
expect(EDB::Cryptography.supports?('AES_256_CBC')).to be_truthy
8+
end
9+
end
10+
11+
context 'given algorithm is not supported' do
12+
it 'returns false' do
13+
expect(EDB::Cryptography.supports?('LOL_WUT_128')).to be_falsy
14+
end
15+
end
16+
end
17+
end

specs/dbms_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require_relative 'spec_helper'
2+
3+
describe EDB::Storage do
4+
describe '#supports?' do
5+
context 'given storage device is supported' do
6+
it 'returns true' do
7+
expect(EDB::Storage.supports?('S3')).to be_truthy
8+
end
9+
end
10+
11+
context 'given storage device is not supported' do
12+
it 'returns false' do
13+
expect(EDB::Storage.supports?('CappellaAmbrosiana')).to be_falsy
14+
end
15+
end
16+
end
17+
end

specs/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'edb'

specs/storage_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require_relative 'spec_helper'
2+
3+
describe EDB::Cryptography do
4+
describe '#supports?' do
5+
context 'given algorithm is supported' do
6+
it 'returns true' do
7+
expect(EDB::Cryptography.supports?('AES_256_CBC')).to be_truthy
8+
end
9+
end
10+
11+
context 'given algorithm is not supported' do
12+
it 'returns false' do
13+
expect(EDB::Cryptography.supports?('LOL_WUT_128')).to be_falsy
14+
end
15+
end
16+
end
17+
end

0 commit comments

Comments
 (0)