Sha256: 916c216e0835225d73e7c5e137b5b52015d28f55ff51280d9c33d0d85beef601
Contents?: true
Size: 818 Bytes
Versions: 3
Compression:
Stored size: 818 Bytes
Contents
require 'spec_helper' describe Sdbport do before do @config = { 'test123' => { 'access_key' => 'key', 'secret_key' => 'secret' } } end it "should create a new config object and read from ~/.sdbport.yml" do File.stub :exists? => true File.should_receive(:open). with("#{ENV['HOME']}/.sdbport.yml"). and_return @config.to_yaml config = Sdbport::Config.new config.access_key('test123').should == 'key' config.secret_key('test123').should == 'secret' end it "should return nil if .sdbport.yml does not exist" do File.stub :exists? => false config = Sdbport::Config.new config.access_key('test123').should be_nil config.secret_key('test123').should be_nil end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sdbport-0.4.1 | spec/config_spec.rb |
sdbport-0.4.0 | spec/config_spec.rb |
sdbport-0.3.0 | spec/config_spec.rb |