Class: Proletariat::Testing::Expectation

Inherits:
Struct
  • Object
show all
Defined in:
lib/proletariat/testing/expectation.rb

Overview

Internal: Defines a quantity of messages you expect to receive on a set

of topics.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#quantityObject

Returns the value of attribute quantity

Returns:

  • (Object)

    the current value of quantity



5
6
7
# File 'lib/proletariat/testing/expectation.rb', line 5

def quantity
  @quantity
end

#topicsObject

Returns the value of attribute topics

Returns:

  • (Object)

    the current value of topics



5
6
7
# File 'lib/proletariat/testing/expectation.rb', line 5

def topics
  @topics
end

Instance Method Details

#on_topic(*topics) ⇒ Object

Public: Builds a new duplicate of current instance with different

topics.

Returns a new instance of Expectation.



10
11
12
# File 'lib/proletariat/testing/expectation.rb', line 10

def on_topic(*topics)
  Expectation.new(topics, quantity)
end