spec/unit/a9n_spec.rb in a9n-0.5.7 vs spec/unit/a9n_spec.rb in a9n-0.6.0
- old
+ new
@@ -8,16 +8,18 @@
subject.instance_variable_set(:@env, nil)
end
context "app_env is set" do
before do
- expect(subject).to receive(:app).and_return(double(env: "dwarf_env")).exactly(3).times
+ expect(subject).to receive(:app).and_return(double(env: ::A9n::StringInquirer.new("dwarf_env"))).exactly(3).times
expect(subject).to receive(:env_var).never
end
it do
expect(subject.env).to eq("dwarf_env")
+ expect(subject.env.dwarf_env?).to eq(true)
+ expect(subject.env.production?).to eq(false)
end
end
context "when APP_ENV is set" do
before do
@@ -27,9 +29,11 @@
expect(subject).to receive(:env_var).with("APP_ENV").and_return("dwarf_env")
end
it do
expect(subject.env).to eq("dwarf_env")
+ expect(subject.env.dwarf_env?).to eq(true)
+ expect(subject.env.production?).to eq(false)
end
end
end
describe ".app" do