Module: Tochtli::Test::Helpers
Instance Method Summary
collapse
append_features, included
Instance Method Details
#assert_published(message_class, attributes = {}) {|@message| ... } ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/tochtli/test/test_case.rb', line 13
def assert_published(message_class, attributes={})
publication = @connection.get_publication
assert !publication.nil?, "No message published"
@message = publication[:message]
assert_kind_of message_class, @message
attributes.each do |attr_name, value|
assert_equal value, @message.send(attr_name), "Message attribute :#{attr_name} value does not match"
end
yield @message if block_given?
@message
end
|
#before_setup ⇒ Object
8
9
10
11
|
# File 'lib/tochtli/test/test_case.rb', line 8
def before_setup
super
@connection = TestRabbitConnection.new
end
|
#expect_published(message_class, attributes = {}) ⇒ Object
25
26
27
28
29
30
|
# File 'lib/tochtli/test/test_case.rb', line 25
def expect_published(message_class, attributes={})
@connection.callback do
assert_published message_class, attributes
yield @message
end
end
|