Skip to content

Commit

Permalink
Add tests for FileParamStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
giginet committed Jul 18, 2018
1 parent 76fd80e commit 3f88b62
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions spec/lib/fabricio/authorization/file_param_storage_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require 'rspec'
require 'fabricio/authorization/file_session_storage'
require 'fabricio/authorization/file_param_storage'

describe 'FileParamStorage' do
let(:path) { '/path/to/params.yml' }
let(:yaml) do
yaml = <<-YAML
organization_id: my_organization
app_id: my_app
YAML
YAML.load(yaml)
end

before(:each) do
allow(YAML).to receive(:load_file).with(path).and_return(yaml)
allow(File).to receive(:exist?).with(path).and_return(true)
@storage = Fabricio::Authorization::FileParamStorage.new(path)
end

describe '#organization_id' do
it { expect(@storage.organization_id).to eq('my_organization') }
end

describe '#app_id' do
it { expect(@storage.app_id).to eq('my_app') }
end
end

0 comments on commit 3f88b62

Please sign in to comment.