Parent

CI::Reporter::Cucumber

Attributes

name[RW]
report_manager[RW]
test_suite[RW]

Public Class Methods

new(step_mother, io, options) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 45
def initialize(step_mother, io, options)
  @report_manager = ReportManager.new("features")
end

Public Instance Methods

after_background(*args) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 64
def after_background(*args)
end
after_examples(*args) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 100
def after_examples(*args)
end
after_feature(feature) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 54
def after_feature(feature)
  test_suite.name = @name
  test_suite.finish
  report_manager.write_report(@test_suite)
  @test_suite = nil
end
after_steps(steps) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 80
def after_steps(steps)
  @test_case.finish

  case steps.status
  when :pending, :undefined
    @test_case.name = "#{@test_case.name} (PENDING)"
  when :skipped
    @test_case.name = "#{@test_case.name} (SKIPPED)"
  when :failed
    @test_case.failures << CucumberFailure.new(steps)
  end

  test_suite.testcases << @test_case
  @test_case = nil
end
after_table_row(table_row) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 113
def after_table_row(table_row)
  if @header_row
    @header_row = false
    return
  end
  @test_case.finish
  if table_row.respond_to? :failed?
    @test_case.failures << CucumberFailure.new(table_row) if table_row.failed?
    test_suite.testcases << @test_case
    @test_case = nil
  end
end
before_background(*args) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 61
def before_background(*args)
end
before_examples(*args) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 96
def before_examples(*args)
  @header_row = true
end
before_feature(feature) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 49
def before_feature(feature)
  self.test_suite = TestSuite.new(@name)
  test_suite.start
end
before_steps(steps) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 75
def before_steps(steps)
  @test_case = TestCase.new(@scenario)
  @test_case.start
end
before_table_row(table_row) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 103
def before_table_row(table_row)
  row = table_row # shorthand for table_row
  # check multiple versions of the row and try to find the best fit
  outline = (row.respond_to? :name)             ? row.name :
            (row.respond_to? :scenario_outline) ? row.scenario_outline :
                                                  row.to_s
  @test_case = TestCase.new("#@scenario (outline: #{outline})")
  @test_case.start
end
feature_name(keyword, name) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 67
def feature_name(keyword, name)
  @name = (name || "Unnamed feature").split("\n").first
end
scenario_name(keyword, name, *args) click to toggle source
# File lib/ci/reporter/cucumber.rb, line 71
def scenario_name(keyword, name, *args)
  @scenario = (name || "Unnamed scenario").split("\n").first
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.