Sha256: 9c34ce2824c1f62e7b0afc43b6cb6e7f1fddcad7745628d5012fb58c843c8417

Contents?: true

Size: 809 Bytes

Versions: 7

Compression:

Stored size: 809 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe DeepL::Resources::Usage do
  subject { described_class.new(3, 5, nil, nil) }

  describe '#initialize' do
    context 'When building a basic object' do
      it 'should create a resource' do
        expect(subject).to be_a(described_class)
      end

      it 'should assign the attributes' do
        expect(subject.character_count).to eq(3)
        expect(subject.character_limit).to eq(5)
      end

      it 'should not exceed the quota' do
        expect(subject.quota_exceeded?).to be_falsey
      end
    end

    context 'When building a quota exceeded object' do
      subject { described_class.new(5, 5, nil, nil) }

      it 'should exceed the quota' do
        expect(subject.quota_exceeded?).to be_truthy
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
deepl-rb-2.5.3 spec/resources/usage_spec.rb
deepl-rb-2.5.2 spec/resources/usage_spec.rb
deepl-rb-2.5.1 spec/resources/usage_spec.rb
deepl-rb-2.5.0 spec/resources/usage_spec.rb
deepl-rb-2.4.0 spec/resources/usage_spec.rb
deepl-rb-2.3.1 spec/resources/usage_spec.rb
deepl-rb-2.3.0 spec/resources/usage_spec.rb