Sha256: f9d1e892f69079b158c0baceca01694d33013492361830a8f2bafcd908d7f5e2

Contents?: true

Size: 1.03 KB

Versions: 83

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/ruby'

RSpec.describe ::EacRubyUtils::Ruby do
  describe '#on_clean_environment' do
    let(:envvar_name) { 'BUNDLE_NOT_EXISTENT_ENV_VAR' }
    let(:envvar_value) { 'any value' }
    let(:noruby_envvar_name) { 'ANY_ENVIRONMENT_VARIABLE' }
    let(:noruby_envvar_value) { 'another any value' }

    before do
      ENV[envvar_name] = envvar_value
      ENV[noruby_envvar_name] = noruby_envvar_value
    end

    it do # rubocop:disable RSpec/MultipleExpectations
      expect(ENV[envvar_name]).to eq(envvar_value)
      described_class.on_clean_environment do
        expect(ENV[envvar_name]).to eq(nil)
      end
      expect(ENV[envvar_name]).to eq(envvar_value)
    end

    it do # rubocop:disable RSpec/MultipleExpectations
      expect(ENV[noruby_envvar_name]).to eq(noruby_envvar_value)
      described_class.on_clean_environment do
        expect(ENV[noruby_envvar_name]).to eq(noruby_envvar_value)
      end
      expect(ENV[noruby_envvar_name]).to eq(noruby_envvar_value)
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
eac_tools-0.76.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.76.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.75.2 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.75.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.75.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.74.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.74.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.73.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.72.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.70.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.70.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.69.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.69.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.68.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.67.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.67.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.66.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.65.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.65.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb
eac_tools-0.64.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/ruby/on_clean_environment_spec.rb