Sha256: f55990cf8f9ded022d6423041dc434970328474ce7c840b36d58c99e8ba02884

Contents?: true

Size: 1.3 KB

Versions: 4

Compression:

Stored size: 1.3 KB

Contents

# Copyright 2022 Daniel Herzog
# Use of this source code is governed by an MIT
# license that can be found in the LICENSE.md file.
# frozen_string_literal: true

require 'spec_helper'

describe DeepL::Resources::Glossary do
  subject(:glossary) do
    described_class.new({
                          'glossary_id' => 'def3a26b-3e84-45b3-84ae-0c0aaf3525f7',
                          'name' => 'Mein Glossar',
                          'ready' => true,
                          'source_lang' => 'EN',
                          'target_lang' => 'DE',
                          'creation_time' => '2021-08-03T14:16:18.329Z',
                          'entry_count' => 1
                        }, nil, nil)
  end

  describe '#initialize' do
    context 'when building a basic object' do
      it 'creates a resource' do
        expect(glossary).to be_a(described_class)
      end

      it 'assigns the attributes' do
        expect(glossary.id).to eq('def3a26b-3e84-45b3-84ae-0c0aaf3525f7')
        expect(glossary.name).to eq('Mein Glossar')
        expect(glossary.ready).to be(true)
        expect(glossary.source_lang).to eq('EN')
        expect(glossary.target_lang).to eq('DE')
        expect(glossary.creation_time).to eq('2021-08-03T14:16:18.329Z')
        expect(glossary.entry_count).to eq(1)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
deepl-rb-3.1.0 spec/resources/glossary_spec.rb
deepl-rb-3.0.2 spec/resources/glossary_spec.rb
deepl-rb-3.0.1 spec/resources/glossary_spec.rb
deepl-rb-3.0.0 spec/resources/glossary_spec.rb