Sha256: 4a407d53d2a27a5dd6c6115943300bf799c3e077692456e6db301ef0659cc3d7

Contents?: true

Size: 749 Bytes

Versions: 2

Compression:

Stored size: 749 Bytes

Contents

require "spec_helper"
require "lol"

include Lol

describe League do
  it "inherits from Lol::Model" do
    expect(League.ancestors[1]).to eq(Model)
  end

  context "initialization" do
    it_behaves_like 'Lol model' do
      let(:valid_attributes) { { timestamp: 123456 } }
    end

    %w(timestamp name tier queue).each do |attribute|
      describe "#{attribute} attribute" do
        it_behaves_like 'plain attribute' do
          let(:attribute) { attribute }
          let(:attribute_value) { 'asd' }
        end
      end
    end

    it "fills entries with LeagueEntry objects" do
      league = League.new(load_fixture("league", "v2.1", "get")["foo"])
      expect(league.entries.map(&:class).uniq).to eq([LeagueEntry])
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-lol-0.0.7 spec/lol/league_spec.rb
ruby-lol-0.0.6 spec/lol/league_spec.rb