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