Sha256: 728d1c7a441234483040398f3e50355fe19cb70e3910e8e63b3a74a2aa844f5f

Contents?: true

Size: 901 Bytes

Versions: 15

Compression:

Stored size: 901 Bytes

Contents

# frozen_string_literal: true

require 'cucumber/ci_environment'
require 'json'

describe 'detect_ci_environment' do
  Dir.glob('../testdata/*.txt') do |test_data_file|
    context "with #{File.basename(test_data_file, '.txt')}" do
      subject { JSON.parse(ci_environment.to_json) }

      let(:ci_environment) { Cucumber::CiEnvironment.detect_ci_environment(env) }
      let(:env) { Hash[entries] }
      let(:entries) { env_data.split(/\n/).map { |line| line.split(/=/) } }
      let(:env_data) { IO.read(test_data_file) }

      let(:expected_json) { File.read("#{test_data_file}.json") }

      it { is_expected.to eq JSON.parse(expected_json) }
    end
  end

  context 'with no CI environment' do
    subject { JSON.parse(ci_environment.to_json) }
    let(:ci_environment) { Cucumber::CiEnvironment.detect_ci_environment(env) }
    let(:env) { {} }

    it { is_expected.to be_nil }
  end
end

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
cucumber-ci-environment-10.0.1 spec/cucumber/ci_environment/ci_environment_spec.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-ci-environment-9.2.0/spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-10.0.0 spec/cucumber/ci_environment/ci_environment_spec.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-ci-environment-9.2.0/spec/cucumber/ci_environment/ci_environment_spec.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-ci-environment-9.1.0/spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-9.2.0 spec/cucumber/ci_environment/ci_environment_spec.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-ci-environment-9.1.0/spec/cucumber/ci_environment/ci_environment_spec.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-ci-environment-9.1.0/spec/cucumber/ci_environment/ci_environment_spec.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-ci-environment-9.1.0/spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-9.1.0 spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-9.0.4 spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-9.0.3 spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-9.0.0 spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-8.1.0 spec/cucumber/ci_environment/ci_environment_spec.rb
cucumber-ci-environment-8.0.1 spec/cucumber/ci_environment/ci_environment_spec.rb