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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b83061e0f02354f4d4fecfac49bf484baf1f8e6f
4
- data.tar.gz: 3efd1555d5df17f70fb630f262063aa25ed69aa7
3
+ metadata.gz: 6396c8ee65107b226bdada664bbb77f1efd04e98
4
+ data.tar.gz: 19ab3c9d51572fad6159330d5986daadd8e0dce2
5
5
  SHA512:
6
- metadata.gz: 6a6a6b2d2d3a66f64eac0126a3403a56316334dc8ca74b9e2a4452cfd252b9e05035be56e5df2bc097088f3861c5444d3511dd644a35163c71344e3bed45c7e3
7
- data.tar.gz: 8a177acad7731a20382395b0c1273f2f0072740fb478e5adcbe680f9c7f4ce4bb42394fdb881dcb3974f7cd8207b6198a9b918bd3322cfa22455422daee94a00
6
+ metadata.gz: 2ad86b25c9d3c7afc3c4b930e0bc1917346a51420f739fe520af4f7b020e2bca1ef184c6b94ddcbc737f2ad4915fc26cf50075d23783cd2ca7281129e57e4de2
7
+ data.tar.gz: 5866f371ab83e38b949019d884c49b7f1fcc32e63bd7a57029c2d7751278489a48448a5f04a34d672a741016379621c4269432ed2462296db789cab332cb9e02
@@ -4,7 +4,7 @@ module Shogun
4
4
  verifiers.all?(&:valid?)
5
5
  end
6
6
 
7
- def to_array
7
+ def invalids
8
8
  verifiers.reject(&:valid?)
9
9
  end
10
10
 
@@ -1,3 +1,3 @@
1
1
  module Shogun
2
- VERSION = "4.0.1"
2
+ VERSION = "6.0.0"
3
3
  end
@@ -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.0.1
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-14 00:00:00.000000000 Z
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.2
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:
@@ -1,5 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Shogun::Verifier do
4
-
5
- end