Class: Spectr

Inherits:
Object
  • Object
show all
Defined in:
lib/spectr.rb

Instance Method Summary collapse

Instance Method Details

#assume(assumption, expected_result) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/spectr.rb', line 9

def assume(assumption, expected_result)
  @assumption = assumption
  @expected_result = expected_result
  begin
    @result = yield
  rescue => e
    @result = e
  end
  compare
  exit 255 if @abort
end

#test(description) {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Spectr)

    the object that the method was called on



2
3
4
5
6
7
# File 'lib/spectr.rb', line 2

def test(description)
  @description = description
  puts "INFO: #{description}"
  yield self
  self
end