Class: CommandUnit::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/command-unit/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(when_i_text, &when_i_block) ⇒ Test

Returns a new instance of Test.



4
5
6
7
8
# File 'lib/command-unit/test.rb', line 4

def initialize(when_i_text, &when_i_block)
  @when_i_text = when_i_text
  @when_i_block = when_i_block
  @expectations = []
end

Instance Attribute Details

#expectationsObject (readonly)

Returns the value of attribute expectations.



9
10
11
# File 'lib/command-unit/test.rb', line 9

def expectations
  @expectations
end

#when_i_blockObject (readonly)

Returns the value of attribute when_i_block.



9
10
11
# File 'lib/command-unit/test.rb', line 9

def when_i_block
  @when_i_block
end

#when_i_textObject (readonly)

Returns the value of attribute when_i_text.



9
10
11
# File 'lib/command-unit/test.rb', line 9

def when_i_text
  @when_i_text
end

Instance Method Details

#add_expectation(expectation) ⇒ Object



10
11
12
# File 'lib/command-unit/test.rb', line 10

def add_expectation(expectation)
  @expectations.push expectation
end