Module: Kernel

Defined in:
lib/machospec.rb

Instance Method Summary collapse

Instance Method Details

#describe(comment) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/machospec.rb', line 2

def describe(comment)
  puts comment.red
  if block_given?
    yield
  else
    p "Missing block"
  end
end

#it(comment) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/machospec.rb', line 11

def it(comment)
  if block_given?
    begin
      yield
      puts comment.green
    rescue => e
      puts comment.red
      puts e.to_s.red
    end
  else
    puts "#{comment} pending"
  end
end