Sha256: bd75d4c3ac450f818184c7ca52ab89404fe20893aee9eaa62a3c390541278301

Contents?: true

Size: 1.6 KB

Versions: 8

Compression:

Stored size: 1.6 KB

Contents

require File.expand_path('../spec_helper', __FILE__)

describe ITunes do
  after do
    ITunes.reset
  end

  use_vcr_cassette :record => :new_episodes, :match_requests_on => [:uri, :method]

  context "when delegating to a client" do
    it "should return the same results as a client" do
      ITunes.music('Jose James').should == ITunes::Client.new.music('Jose James')
    end
  end

  describe '.client' do
    it 'should return and ITunes::Client' do
      ITunes.client.should be_a ITunes::Client
    end
  end

  describe '.respond_to?' do
    it "should take an optional argument" do
      ITunes.respond_to?(:new, true).should be_true
    end
  end

  describe ".new" do
    it "should return an ITunes::Client" do
      ITunes.new.should be_a ITunes::Client
    end
  end

  describe ".limit" do
    it 'should return the default limit' do
      ITunes.limit.should == ITunes::Configuration::DEFAULT_LIMIT
    end
  end

  describe ".limit=" do
    it "should set the limit" do
      ITunes.limit = 5
      ITunes.limit.should == 5
    end
  end

  describe ".adapter" do
    it "should instantiate with the default adapter" do
      ITunes.adapter.should == Faraday.default_adapter
    end
  end

  describe ".adapter=" do
    it "should set the adapter" do
      ITunes.adapter = :typhoeus
      ITunes.adapter.should == :typhoeus
    end
  end

  describe ".configure" do
    ITunes::Configuration::VALID_OPTIONS_KEYS.each do |key|
      it "should set the #{key}" do
        ITunes.configure do |config|
          config.send("#{key}=", key)
          ITunes.send(key).should == key
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
itunes-0.7.0 spec/itunes_spec.rb
itunes-0.6.0 spec/itunes_spec.rb
itunes-0.5.5 spec/itunes_spec.rb
itunes-0.5.4 spec/itunes_spec.rb
itunes-0.5.3 spec/itunes_spec.rb
itunes-0.5.2 spec/itunes_spec.rb
itunes-0.5.1 spec/itunes_spec.rb
itunes-0.5.0 spec/itunes_spec.rb