brew/Library/Homebrew/test/build_environment_spec.rb

46 lines
904 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
2017-02-11 18:21:30 +01:00
require "build_environment"
describe BuildEnvironment do
let(:env) { described_class.new }
describe "#<<" do
it "returns itself" do
expect(env << :foo).to be env
end
end
describe "#merge" do
it "returns itself" do
expect(env.merge([])).to be env
end
end
describe "#std?" do
it "returns true if the environment contains :std" do
env << :std
expect(env).to be_std
end
it "returns false if the environment does not contain :std" do
expect(env).not_to be_std
end
end
2017-05-09 23:00:51 +02:00
describe BuildEnvironment::DSL do
subject(:build_environment_dsl) { double.extend(described_class) }
2017-02-11 18:21:30 +01:00
context "with a single argument" do
before do
build_environment_dsl.instance_eval do
env :std
2017-05-09 23:00:51 +02:00
end
2017-02-11 18:21:30 +01:00
end
2017-05-09 23:00:51 +02:00
its(:env) { is_expected.to be_std }
end
2017-02-11 18:21:30 +01:00
end
end