File: report_api_spy.rb

package info (click to toggle)
ruby-cucumber-core 1.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 580 kB
  • sloc: ruby: 5,763; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class ReportAPISpy
  def initialize
    @result = []
  end

  def test_case(*args)
    @result << [:test_case, *args]
    yield self if block_given?
  end

  def test_step(*args)
    @result << [:test_step, *args]
    yield self if block_given?
  end

  def done(*args)
    @result << [:done, *args]
    yield self if block_given?
  end

  def messages
    @result.map(&:first)
  end
end