Sha256: 9452075e865416be4022f32b76041dfe452faf21a6a8c2b75b7d0cccfe2e6284

Contents?: true

Size: 888 Bytes

Versions: 4

Compression:

Stored size: 888 Bytes

Contents

require_relative 'spec_helper'

require_relative '../lib/doc_juan/config.rb'

describe DocJuan::Configuration do
  after :each do
    DocJuan.config.secret = nil
    DocJuan.config.host = nil
    DocJuan.config.username = nil
    DocJuan.config.password = nil
  end

  it 'is configurable' do
    DocJuan.config.secret = 'very-secret'
    DocJuan.config.host = 'http://my-doc-juan-host.com'
    DocJuan.config.username = 'a-username'
    DocJuan.config.password = 'the-password'

    DocJuan.config.secret.must_equal 'very-secret'
    DocJuan.config.host.must_equal 'http://my-doc-juan-host.com'
    DocJuan.config.username.must_equal 'a-username'
    DocJuan.config.password.must_equal 'the-password'
  end

  it 'is configurable with a block' do
    DocJuan.configure do |config|
      config.secret = 'very-secret'
    end

    DocJuan.config.secret.must_equal 'very-secret'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
doc_juan-1.2.2 spec/configuration_spec.rb
doc_juan-1.2.1 spec/configuration_spec.rb
doc_juan-1.2.0 spec/configuration_spec.rb
doc_juan-1.1.0 spec/configuration_spec.rb