shogun 4.0.1 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shogun/validator.rb +1 -1
- data/lib/shogun/version.rb +1 -1
- data/spec/lib/shogun/server_spec.rb +12 -0
- data/spec/lib/shogun/validator_spec.rb +68 -0
- metadata +3 -5
- data/spec/lib/shogun/verifier_spec.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6396c8ee65107b226bdada664bbb77f1efd04e98
|
4
|
+
data.tar.gz: 19ab3c9d51572fad6159330d5986daadd8e0dce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ad86b25c9d3c7afc3c4b930e0bc1917346a51420f739fe520af4f7b020e2bca1ef184c6b94ddcbc737f2ad4915fc26cf50075d23783cd2ca7281129e57e4de2
|
7
|
+
data.tar.gz: 5866f371ab83e38b949019d884c49b7f1fcc32e63bd7a57029c2d7751278489a48448a5f04a34d672a741016379621c4269432ed2462296db789cab332cb9e02
|
data/lib/shogun/validator.rb
CHANGED
data/lib/shogun/version.rb
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Shogun::Server do
|
4
|
+
let("described_class") do
|
5
|
+
Class.new { include Shogun::Server }
|
6
|
+
end
|
4
7
|
|
8
|
+
let("server") do
|
9
|
+
described_class.new
|
10
|
+
end
|
11
|
+
|
12
|
+
describe "#serve" do
|
13
|
+
let("serve") do
|
14
|
+
server.serve
|
15
|
+
end
|
16
|
+
end
|
5
17
|
end
|
@@ -1,5 +1,73 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Shogun::Validator do
|
4
|
+
let("described_class") do
|
5
|
+
Class.new { include Shogun::Validator }
|
6
|
+
end
|
4
7
|
|
8
|
+
let("validator") do
|
9
|
+
described_class.new
|
10
|
+
end
|
11
|
+
|
12
|
+
let("verifier_a") do
|
13
|
+
instance_double("Verifier")
|
14
|
+
end
|
15
|
+
|
16
|
+
let("verifier_b") do
|
17
|
+
instance_double("Verifier")
|
18
|
+
end
|
19
|
+
|
20
|
+
let("verifiers") do
|
21
|
+
[verifier_a, verifier_b]
|
22
|
+
end
|
23
|
+
|
24
|
+
before("each") do
|
25
|
+
allow(verifier_a).to receive("valid?").and_return(true)
|
26
|
+
allow(verifier_b).to receive("valid?").and_return(true)
|
27
|
+
allow(validator).to receive("verifiers").and_return(verifiers)
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "#invalids" do
|
31
|
+
let("invalids") do
|
32
|
+
validator.invalids
|
33
|
+
end
|
34
|
+
|
35
|
+
context "if all verifiers are valid" do
|
36
|
+
it "returns an empty array" do
|
37
|
+
expect(invalids).to eq([])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "if some verifiers are invalid" do
|
42
|
+
before("each") do
|
43
|
+
allow(verifier_b).to receive("valid?").and_return(false)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "returns the invalid verifiers" do
|
47
|
+
expect(invalids).to include(verifier_b)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
describe "#valid?" do
|
53
|
+
let("valid?") do
|
54
|
+
validator.valid?
|
55
|
+
end
|
56
|
+
|
57
|
+
context "if all verifiers are valid" do
|
58
|
+
it "returns true" do
|
59
|
+
expect(valid?).to be(true)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
context "if some verifiers are invalid" do
|
64
|
+
before("each") do
|
65
|
+
allow(verifier_b).to receive("valid?").and_return(false)
|
66
|
+
end
|
67
|
+
|
68
|
+
it "returns false" do
|
69
|
+
expect(valid?).to be(false)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
5
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shogun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kurtis Rainbolt-Greene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: adamantium
|
@@ -344,7 +344,6 @@ files:
|
|
344
344
|
- spec/lib/shogun/verifier/presence_spec.rb
|
345
345
|
- spec/lib/shogun/verifier/range_spec.rb
|
346
346
|
- spec/lib/shogun/verifier/uniqueness_spec.rb
|
347
|
-
- spec/lib/shogun/verifier_spec.rb
|
348
347
|
- spec/spec_helper.rb
|
349
348
|
homepage: http://krainboltgreene.github.io/shogun
|
350
349
|
licenses:
|
@@ -366,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
366
365
|
version: '0'
|
367
366
|
requirements: []
|
368
367
|
rubyforge_project:
|
369
|
-
rubygems_version: 2.4.
|
368
|
+
rubygems_version: 2.4.3
|
370
369
|
signing_key:
|
371
370
|
specification_version: 4
|
372
371
|
summary: The core library for an HTTP API framework
|
@@ -392,6 +391,5 @@ test_files:
|
|
392
391
|
- spec/lib/shogun/verifier/presence_spec.rb
|
393
392
|
- spec/lib/shogun/verifier/range_spec.rb
|
394
393
|
- spec/lib/shogun/verifier/uniqueness_spec.rb
|
395
|
-
- spec/lib/shogun/verifier_spec.rb
|
396
394
|
- spec/spec_helper.rb
|
397
395
|
has_rdoc:
|