Sha256: 7c3af22268907f1bf66359b48720a0001f60a0d4e43694e973d3c517cf480288

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

require 'spec_helper'

describe FormStalker do
  describe '.configure' do
    context 'when setting the "config.oauth_token"' do
      before do
        FormStalker.configure { |config| config.oauth_token = '123' }
      end
      after do
        FormStalker.configure { |config| config.oauth_token = nil }
      end

      it 'FormStalker.config.oauth_token should reflect that change' do
        expect(FormStalker.config.oauth_token).to eq '123'
      end

      context 'when setting the "config.oauth_token" yet again' do
        before do
          FormStalker.configure { |config| config.oauth_token = '1234' }
        end
        after do
          FormStalker.configure { |config| config.oauth_token = nil }
        end

        it 'FormStalker.config.oauth_token should reflect that change' do
          expect(FormStalker.config.oauth_token).to eq '1234'
        end
      end
    end
  end

  describe '.config' do
    context 'when setting the #oauth_token' do
      before { FormStalker.config.oauth_token = '123' }
      after { FormStalker.config.oauth_token = nil }

      it 'FormStalker.client.config.oauth_token should reflect that change' do
        expect(FormStalker.client.config.oauth_token).to eq '123'
      end
    end
  end

  describe '.client' do
    context 'when setting the #config.oauth_token' do
      before { FormStalker.client.config.oauth_token = '123' }
      after { FormStalker.client.config.oauth_token = nil }

      it 'FormStalker.config.oauth_token should reflect that change' do
        expect(FormStalker.config.oauth_token).to eq '123'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
form_stalker-1.0.0 spec/form_stalker/form_stalker_spec.rb