lacerda 2.1.1.beta5 → 2.1.1.beta6
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/lacerda/infrastructure.rb +4 -3
- data/lib/lacerda/reporter.rb +1 -1
- data/lib/lacerda/reporters/rspec.rb +10 -7
- data/lib/lacerda/reporters/stdout.rb +15 -2
- data/lib/lacerda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 890f74d8678e19e74e1acefa6b1484b9b46f8fb5
|
4
|
+
data.tar.gz: 9ed29db508e646395fefe47d2a49e894bffa2854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98f93e23f2135ed0de4cb92677e6d6403ac4cce83fd67f1e3f8a79f58b495a4eb6cdee9b02f3a0492df8c1eca3542fd704945aad2d1b94f7685ca55392282d27
|
7
|
+
data.tar.gz: 40985622b438b661246fbb54ce09e38ea9d832747d5d65e016e26b8be574cecb6bb4c9f0dc2f9f8b6d95c386c65344fb64f35e3a0e8a94190c68525bdfab514c
|
@@ -37,13 +37,14 @@ module Lacerda
|
|
37
37
|
consumers.each do |consumer|
|
38
38
|
reporter.try(:check_consumer, consumer)
|
39
39
|
consumer.consumed_objects.each do |object|
|
40
|
-
|
41
|
-
|
40
|
+
publisher_exists = !object.publisher.nil?
|
41
|
+
is_published = publisher_exists && object.publisher.publishes?(object.name)
|
42
|
+
reporter.try(:check_consumed_object, object.name, object.publisher_name.camelize, publisher_exists, is_published)
|
43
|
+
if publisher_exists
|
42
44
|
next
|
43
45
|
else
|
44
46
|
missing_publishers[object.publisher_name.camelize] ||= []
|
45
47
|
missing_publishers[object.publisher_name.camelize] << consumer.name.camelize
|
46
|
-
reporter.try(:object_publisher_existing, object.name, object.publisher_name.camelize, false)
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
data/lib/lacerda/reporter.rb
CHANGED
@@ -29,7 +29,7 @@ module Lacerda
|
|
29
29
|
# Called before all consumed objects are iterated
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def check_published_object(consumed_object_name, publisher_name, publisher_exists, is_published)
|
33
33
|
# Called after a consumed object was inspected (does a publish specification
|
34
34
|
# for this object exist?)
|
35
35
|
end
|
@@ -19,15 +19,14 @@ module Lacerda
|
|
19
19
|
"- #{error[:error]} in #{error[:location]}: #{error[:message]}"
|
20
20
|
end
|
21
21
|
msg = "expected #{@current_publisher.description} to satisfy "\
|
22
|
-
|
23
|
-
|
22
|
+
"#{consumer.name} but found these errors:\n"\
|
23
|
+
" #{error_messages.join("\n")}"
|
24
24
|
@current_publisher.it "satisfies #{consumer.name}" do
|
25
25
|
expect(error_messages).to be_empty, msg
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
def check_publishing
|
30
|
-
@current_consumer.try(:run)
|
31
30
|
@publish_group = @group.describe("publishers")
|
32
31
|
end
|
33
32
|
|
@@ -40,13 +39,17 @@ module Lacerda
|
|
40
39
|
end
|
41
40
|
|
42
41
|
def check_consumer(service)
|
43
|
-
@current_consumer.try(:run)
|
44
42
|
@current_consumer = @consume_group.describe("#{service.try(:name)} consuming")
|
45
43
|
end
|
46
44
|
|
47
|
-
def
|
48
|
-
|
49
|
-
|
45
|
+
def check_consumed_object(consumed_object_name, publisher_name, publisher_exists, is_published)
|
46
|
+
error = if !publisher_exists
|
47
|
+
"Publisher #{publisher_name} does not exist"
|
48
|
+
elsif !is_published
|
49
|
+
"#{publisher_name} does not publish #{consumed_object_name}"
|
50
|
+
end
|
51
|
+
@current_consumer.it "#{consumed_object_name} from #{publisher_name}" do
|
52
|
+
expect(publisher_exists && is_published).to eq(true), error
|
50
53
|
end
|
51
54
|
end
|
52
55
|
|
@@ -43,9 +43,22 @@ module Lacerda
|
|
43
43
|
@io.print "\nObjects consumed by #{consuming_service.name.camelize}: "
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
|
47
|
+
def check_consumed_object(object)
|
48
|
+
error = if object.publisher.nil?
|
49
|
+
"Publisher #{object.publisher_name} does not exist"
|
50
|
+
elsif !object.publisher.publishes?(object.name)
|
51
|
+
"#{object.publisher.name} does not publish #{object.name}"
|
52
|
+
else
|
53
|
+
nil
|
54
|
+
end
|
55
|
+
@current_consumer.it "#{object.name} from #{object.publisher_name}" do
|
56
|
+
expect(error).to(be_nil, error)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
def check_consumed_object(consumed_object_name, publisher_name, publisher_exists, is_published)
|
47
60
|
return unless @verbose
|
48
|
-
if is_published
|
61
|
+
if publisher_exists && is_published
|
49
62
|
@io.print ".".green
|
50
63
|
else
|
51
64
|
@io.print "x".red
|
data/lib/lacerda/version.rb
CHANGED