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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 732b9947f1b14ae426fb81521f97c71db31787a8
4
- data.tar.gz: 568fccf33cecefd14d595e616d9fa5cd8cc165d5
3
+ metadata.gz: 4b5b784274c61e1728070e670433cb83197fb188
4
+ data.tar.gz: a68ce265609b9e9fe4a4363826b2cda76725a957
5
5
  SHA512:
6
- metadata.gz: 4da97e585d8d88580e630c8eaeaba6ffb83f5cf47da8771c340e045049f5394a02360769171cb7ed6ff19217e255fb80136bf37fe15c9673cfefa9d5750b5e59
7
- data.tar.gz: 2f91d653697e862dc113d8c0ab1ab9da8b1e7e81d4c2b5a0b298e99cf2d1c24043395647b55a489ae33797265320e24ceebf368c515f7da77bfd144e86323a5e
6
+ metadata.gz: 244a843b84b04b7dd1a60938e74af3699f857f25b9079b1ef1ba3a4a64d8d8484d0a8495a85e73b185d9765e5852f9316ec114d3828645cb9df161fed7cc7f00
7
+ data.tar.gz: 5a884c976e7006a6ef99c35281d5ce3e24926663a6ea75a3a77daabe8ef5315a5f4a2f011bb029ec4dce73216d1e9c91983455c2955cbf43863774d03113bf32
@@ -1,3 +1,6 @@
1
+ # 0.9.0 (03-Nov-15)
2
+ - add RSpec reporter
3
+
1
4
  # 0.8.0 (30-Oct-15)
2
5
  - support for custom reporters
3
6
  - extract current output into and stdout reporter
@@ -6,7 +6,6 @@ require 'lacerda/infrastructure'
6
6
  require 'lacerda/compare/json_schema'
7
7
  require 'lacerda/reporter'
8
8
  require 'lacerda/reporters/multi'
9
- require 'lacerda/reporters/rspec'
10
9
  require 'lacerda/reporters/stdout'
11
10
 
12
11
  module Lacerda
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Lacerda
2
- VERSION = '0.8.0'
2
+ VERSION = '0.9.0'
3
3
  end
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.8.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-02 00:00:00.000000000 Z
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