Sha256: fbea2ea084f6b2cc8814de9ecccfd9b365db14b9464a90b85384285dfacc578a
Contents?: true
Size: 945 Bytes
Versions: 1
Compression:
Stored size: 945 Bytes
Contents
require "spec_helper" describe "Can use environment variables as a settings list" do it "an example" do ENV["xxx"] = "bangerman" expect(Settings.new.xxx).to eql "bangerman" end it "name may be used (name is interesting because it is implemented on Object)" do ENV["name"] = "bangerman" expect(Settings.new.name).to eql "bangerman" end it "fails when setting does not exist" do ENV.clear expect{Settings.new.name}.to raise_error /Setting <name> not found/ end it "does type matter? Ought I be able to expect numbers for example. Currently all are strings." it "can supply mappings somehow, so you can have shorter ENV names for example. Translate ENV['n'] => 'name'" # Can't use metaclass because class < Object which has lots of methods defined. BasicObject is what we want. end describe "Can use a file on disk" describe "Can use a chain of sources, for example ENV falling back to file on disk"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rsettings-0.0.1 | spec/system.tests/can_use_env_spec.rb |