Sha256: c09a3d15bcf1fe8b7e280dcbe76f1dc0ad339a19878cee013aad26542f26c10c

Contents?: true

Size: 767 Bytes

Versions: 4

Compression:

Stored size: 767 Bytes

Contents

require 'spec_helper'

describe HackernewsRuby do
  let(:client) { HackernewsRuby::Client.new }

  context 'configure defaults' do
    it 'uses default API URL' do
      expect(client.api_url).to eq "https://hacker-news.firebaseio.com"
    end

    it 'uses default API version' do
      expect(client.api_version).to eq "v0"
    end
  end

  context 'custom configuration' do
    let(:custom_client) do
      HackernewsRuby::Client.new(api_url: "https://hackernews.ycomb.com",
                                 api_version: "v1")
    end

    it "::Client API_URL config" do
      expect(custom_client.api_url).to eq "https://hackernews.ycomb.com"
    end

    it "::Client API_VERSION config" do
      expect(custom_client.api_version).to eq "v1"
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hackernews_ruby-0.0.5 spec/hackernews_ruby_spec.rb
hackernews_ruby-0.0.4 spec/hackernews_ruby_spec.rb
hackernews_ruby-0.0.3 spec/hackernews_ruby_spec.rb
hackernews_ruby-0.0.2 spec/hackernews_ruby_spec.rb