Sha256: 64041f87f0acdd08014dd231bf272949fc98660899de5617121731113a2166fd

Contents?: true

Size: 764 Bytes

Versions: 4

Compression:

Stored size: 764 Bytes

Contents

require 'rest-more/test'

require 'rest-core/util/config'

describe RC::Config do

  before do
    @klass = RC::Facebook.dup
  end

  after do
    RR.verify
  end

  def check
    @klass.default_app_id       .should.eq 41829
    @klass.default_secret       .should.eq 'r41829'.reverse
    @klass.default_json_response.should.eq false
    @klass.default_lang         .should.eq 'zh-tw'
  end

  should 'honor rails config' do
    app = Object.new
    mock(app).env { 'test' }
    mock(app).root{ File.dirname(__FILE__) }
    RC::Config.load_for_rails(@klass, 'facebook', app)
    check
  end

  should 'honor config' do
    RC::Config.load(
      @klass,
      "#{File.dirname(__FILE__)}/config/rest-core.yaml",
      'test',
      'facebook')
    check
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rest-more-2.0.4 test/facebook/test_load_config.rb
rest-more-2.0.3 test/facebook/test_load_config.rb
rest-more-2.0.2 test/facebook/test_load_config.rb
rest-more-2.0.0 test/facebook/test_load_config.rb