Sha256: 507dcaee5eb499beeb06db5b0ae2e08cad23edfd11627592ef0b695706328e2f

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

# frozen_string_literal: true

require_relative 'spec_helper'

describe TriviaCrack::User do
  let(:user_id) { 111 }
  let(:user) { TriviaCrack::User.new id: user_id, lives: lives, unlimited_lives: unlimited_lives }

  describe '#start_new_game?' do
    subject { user.start_new_game? }

    context 'when the user has one or more live' do
      let(:lives) { 1 }
      let(:unlimited_lives) { false }

      it { is_expected.to be true }
    end

    context 'when the user has unlimited lives' do
      let(:lives) { 0 }
      let(:unlimited_lives) { true }

      it { is_expected.to be true }
    end

    context 'when the user has no more lives' do
      let(:lives) { 0 }
      let(:unlimited_lives) { false }

      it { is_expected.to be false }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
triviacrack-0.8.0 spec/user_spec.rb
triviacrack-0.7.0 spec/user_spec.rb