Slide 26
Slide 26 text
palkan_tula
palkan
describe Anyway::Loaders::Env do
let(:env) { double("env") }
let(:data) { {"a" => "x", "data" => {"key" => "value"}} }
subject { described_class.call(env_prefix: "TESTO") }
before do
allow(::Anyway::Env).to receive(:new).and_return(env)
allow(env).to receive(:fetch_with_trace).and_return([data, nil])
end
it "loads data from Anyway::Env" do
expect(subject)
.to eq({"a" => "x", "data" => {"key" => "value"}})
end
end
describe Anyway::Loaders::Env do
let(:env) { double("env") }
let(:data) { {"a" => "x", "data" => {"key" => "value"}} }
subject { described_class.call(env_prefix: "TESTO") }
before do
allow(::Anyway::Env).to receive(:new).and_return(env)
allow(env).to receive(:fetch_with_trace).and_return([data, nil])
end
it "loads data from Anyway::Env" do
expect(subject)
.to eq({"a" => "x", "data" => {"key" => "value"}})
end
end
23
Double-factoring