lacerda 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +3 -0
- data/lib/lacerda.rb +0 -1
- data/lib/lacerda/reporters/rspec.rb +42 -0
- data/lib/lacerda/rspec_integration.rb +29 -0
- data/lib/lacerda/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b5b784274c61e1728070e670433cb83197fb188
|
4
|
+
data.tar.gz: a68ce265609b9e9fe4a4363826b2cda76725a957
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 244a843b84b04b7dd1a60938e74af3699f857f25b9079b1ef1ba3a4a64d8d8484d0a8495a85e73b185d9765e5852f9316ec114d3828645cb9df161fed7cc7f00
|
7
|
+
data.tar.gz: 5a884c976e7006a6ef99c35281d5ce3e24926663a6ea75a3a77daabe8ef5315a5f4a2f011bb029ec4dce73216d1e9c91983455c2955cbf43863774d03113bf32
|
data/CHANGELOG.markdown
CHANGED
data/lib/lacerda.rb
CHANGED
@@ -1,6 +1,48 @@
|
|
1
|
+
require 'active_support/core_ext/object/try'
|
2
|
+
|
1
3
|
module Lacerda
|
2
4
|
module Reporters
|
3
5
|
class RSpec < Lacerda::Reporter
|
6
|
+
def initialize(group = RSpec.describe("Lacerda infrastructure contract validation"))
|
7
|
+
@group = group
|
8
|
+
end
|
9
|
+
|
10
|
+
def check_publishing
|
11
|
+
@publish_group = @group.describe("publishers")
|
12
|
+
end
|
13
|
+
|
14
|
+
def check_publisher(service)
|
15
|
+
@current_publisher.try(:run)
|
16
|
+
@current_publisher = @publish_group.describe(service.name)
|
17
|
+
end
|
18
|
+
|
19
|
+
def object_publish_specificaiton_valid(object, valid)
|
20
|
+
@current_publisher.it "-> #{object.consumer.name}" do
|
21
|
+
expect(valid).to be true
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def check_consuming
|
26
|
+
@current_publisher.try(:run)
|
27
|
+
@consume_group = @group.describe("consumers")
|
28
|
+
end
|
29
|
+
|
30
|
+
def check_consumer(service)
|
31
|
+
@current_consumer.try(:run)
|
32
|
+
@current_consumer = @consume_group.describe("#{service.name} consuming")
|
33
|
+
end
|
34
|
+
|
35
|
+
def object_publisher_existing(object, valid)
|
36
|
+
@current_consumer.it "#{object.name} from #{object.publisher.name}" do
|
37
|
+
expect(valid).to be true
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def result(errors)
|
42
|
+
@current_consumer.try(:run)
|
43
|
+
@group.run
|
44
|
+
end
|
45
|
+
|
4
46
|
end
|
5
47
|
end
|
6
48
|
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'lib/lacerda'
|
2
|
+
require 'lib/lacerda/reporters/rspec'
|
3
|
+
|
4
|
+
module Lacerda
|
5
|
+
module RspecIntegration
|
6
|
+
def self.validate_infrastructure(infrastructure)
|
7
|
+
reporter = Lacerda::Reporters::Rspec.new
|
8
|
+
Rspec.describe "Lacerda infrastructure contracts validation" do
|
9
|
+
infrastructure.contracts_fulfilled?(reporter)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# config.after(:suite) do
|
16
|
+
#
|
17
|
+
# example_group = RSpec.describe('Lacerda infrastructure contract validation')
|
18
|
+
# example = example_group.example('must be 100%'){
|
19
|
+
# expect( SimpleCov.result.covered_percent ).to eq 100
|
20
|
+
# }
|
21
|
+
# example_group.run
|
22
|
+
#
|
23
|
+
# passed = example.execution_result.status == :passed
|
24
|
+
# if passed or ENV['IGNORE_LOW_COVERAGE']
|
25
|
+
# RSpec.configuration.reporter.example_passed example
|
26
|
+
# else
|
27
|
+
# RSpec.configuration.reporter.example_failed example
|
28
|
+
# end
|
29
|
+
# end
|
data/lib/lacerda/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lacerda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jannis Hermanns
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -228,6 +228,7 @@ files:
|
|
228
228
|
- lib/lacerda/reporters/multi.rb
|
229
229
|
- lib/lacerda/reporters/rspec.rb
|
230
230
|
- lib/lacerda/reporters/stdout.rb
|
231
|
+
- lib/lacerda/rspec_integration.rb
|
231
232
|
- lib/lacerda/service.rb
|
232
233
|
- lib/lacerda/service/error.rb
|
233
234
|
- lib/lacerda/tasks.rb
|