Sha256: 726dcdbb78a76e2656caca664a92fe1bcc70720cfcc8d726157d556f15bbfcf2

Contents?: true

Size: 1.16 KB

Versions: 17

Compression:

Stored size: 1.16 KB

Contents

require 'cucumber-compatibility-kit'
require 'cucumber/html_formatter'

describe Cucumber::HTMLFormatter.name do

  Cucumber::CompatibilityKit.gherkin_examples.each do |example_name|
    def run_formatter(messages)
      out = StringIO.new
      formatter = Cucumber::HTMLFormatter::Formatter.new(out)
      formatter.process_messages(messages)
      out.string
    end

    describe "'#{example_name}' example" do
      subject(:html_report) { run_formatter(File.readlines(example_ndjson)) }

      let(:example_ndjson) { "#{Cucumber::CompatibilityKit.example_path(example_name)}/#{example_name}.feature.ndjson" }

      it { is_expected.to match(/\A<!DOCTYPE html>\s?<html/) }
      it { is_expected.to match(/<\/html>\Z/) }
    end
  end

  Cucumber::CompatibilityKit.markdown_examples.each do |example_name|
    describe "'#{example_name}' example" do
      let(:example_ndjson) { "#{Cucumber::CompatibilityKit.example_path(example_name)}/#{example_name}.feature.md.ndjson" }
      subject(:html_report) { run_formatter(File.readlines(example_ndjson)) }

      it { is_expected.to match(/\A<!DOCTYPE html>\s?<html/) }
      it { is_expected.to match(/<\/html>\Z/) }
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-html-formatter-20.4.0/spec/acceptance_spec.rb
cucumber-html-formatter-21.0.0 spec/acceptance_spec.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-html-formatter-20.4.0/spec/acceptance_spec.rb
cucumber-html-formatter-20.4.0 spec/acceptance_spec.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/spec/acceptance_spec.rb
cucumber-html-formatter-20.3.1 spec/acceptance_spec.rb
cucumber-html-formatter-20.3.0 spec/acceptance_spec.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/spec/acceptance_spec.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/spec/acceptance_spec.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-html-formatter-19.2.0/spec/acceptance_spec.rb
cucumber-html-formatter-20.2.1 spec/acceptance_spec.rb
cucumber-html-formatter-20.2.0 spec/acceptance_spec.rb
cucumber-html-formatter-20.1.0 spec/acceptance_spec.rb
cucumber-html-formatter-20.0.0 spec/acceptance_spec.rb
cucumber-html-formatter-19.2.0 spec/acceptance_spec.rb
cucumber-html-formatter-19.1.0 spec/acceptance_spec.rb
cucumber-html-formatter-19.0.0 spec/acceptance_spec.rb