sslcheck 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sslcheck.rb +1 -0
- data/lib/sslcheck/certificate.rb +4 -0
- data/lib/sslcheck/version.rb +1 -1
- data/spec/certificate_spec.rb +24 -0
- data/sslcheck.gemspec +2 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3cef80868e3796537488bac3896a10c52853757
|
4
|
+
data.tar.gz: 12dbc2542745a65fbf439798e208290b4a08b744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b003ebe52cfcea15993e6c2234cb161f81794a924605849b4f6fb55bebea91ba9fbb86a0402050a3caa6b86412129cbfb55705ef6d9cb91ef85cb0fca21134e6
|
7
|
+
data.tar.gz: 7ab5cda4f44d57a15ad209a0315c2bce1355da107382cb35843b1844f32eb1a03af6c26263792c5c779298fe01a2fa5b21ee55a12aed5ae052d6f796fc3b0b71
|
data/lib/sslcheck.rb
CHANGED
data/lib/sslcheck/certificate.rb
CHANGED
data/lib/sslcheck/version.rb
CHANGED
data/spec/certificate_spec.rb
CHANGED
@@ -130,5 +130,29 @@ module SSLCheck
|
|
130
130
|
expect(@sut.issued?).to be
|
131
131
|
end
|
132
132
|
end
|
133
|
+
describe "days from expiration" do
|
134
|
+
it 'should know how many days until the certificate expires' do
|
135
|
+
expires_at = Certificate.new(VALID_CERT).not_after
|
136
|
+
clock = class_double(DateTime, :now => expires_at - 30.days)
|
137
|
+
@sut = Certificate.new(VALID_CERT, clock)
|
138
|
+
expect(@sut.expires_in?(30)).to be
|
139
|
+
end
|
140
|
+
context "when it's less than 1 day from expiring" do
|
141
|
+
it 'should still know that it is expiring' do
|
142
|
+
expires_at = Certificate.new(VALID_CERT).not_after
|
143
|
+
clock = class_double(DateTime, :now => expires_at - 12.hours)
|
144
|
+
@sut = Certificate.new(VALID_CERT, clock)
|
145
|
+
expect(@sut.expires_in?(1)).to be
|
146
|
+
end
|
147
|
+
end
|
148
|
+
context "when it's not expiring in the given timeframe" do
|
149
|
+
it 'should not think its expiring within the given number of days' do
|
150
|
+
expires_at = Certificate.new(VALID_CERT).not_after
|
151
|
+
clock = class_double(DateTime, :now => expires_at - 60.days)
|
152
|
+
@sut = Certificate.new(VALID_CERT, clock)
|
153
|
+
expect(@sut.expires_in?(30)).to_not be
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
133
157
|
end
|
134
158
|
end
|
data/sslcheck.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.add_runtime_dependency "activesupport", "~> 4.2"
|
22
|
+
|
21
23
|
spec.add_development_dependency "bundler", "~> 1.7"
|
22
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
25
|
spec.add_development_dependency "rspec", "~> 3.1"
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sslcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clayton Lengel-Zigich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|