class RspecTestlinkExportCases

Attributes

started[R]

Public Instance Methods

dump_summary(notification) click to toggle source
# File lib/rspec_testlink_export_cases.rb, line 22
def dump_summary(notification)
  @summary_notification = notification
  xml_dump
end
start(notification) click to toggle source
Calls superclass method
# File lib/rspec_testlink_export_cases.rb, line 12
def start(notification)
  @start_notification = notification
  @started = Time.now
  super
end
stop(notification) click to toggle source
# File lib/rspec_testlink_export_cases.rb, line 18
def stop(notification)
  @examples_notification = notification
end

Private Instance Methods

example_count() click to toggle source
# File lib/rspec_testlink_export_cases.rb, line 31
def example_count
  @summary_notification.examples.count
end
examples() click to toggle source
# File lib/rspec_testlink_export_cases.rb, line 35
def examples
  @examples_notification.notifications
end
xml() click to toggle source
# File lib/rspec_testlink_export_cases.rb, line 39
def xml
  @xml ||= Builder::XmlMarkup.new target: output, indent: 2
end
xml_dump() click to toggle source
# File lib/rspec_testlink_export_cases.rb, line 43
def xml_dump
        xml.instruct!
        xml.testcases do
                examples.each do |example|
                        xml.testcase name: example.example.description.split('|')[0].strip do
                                xml.summary(example.example.location)
                                xml.status(1)
                                xml.execution_type(2)
                                xml.requirements do
                                        xml.requirement do
                                                xml.doc_id(example.example.example_group.description.split('|')[1].strip)
                                        end
                                end
                                xml.custom_fields do
                                        xml.custom_field do
                                                xml.name('RSPEC CASE ID')
                                                xml.value(example.example.description.split('|')[1].strip)
                                        end
                                end
                        end
                end
        end
end