Sha256: ca5984b664fbecd337556e157b3cc5ad4bcea868314b26633d87d0be326b020f

Contents?: true

Size: 557 Bytes

Versions: 17

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Arstotzka::FetcherBuilder do
  subject(:builder) do
    described_class.new options
  end

  let(:instance) { Arstotzka::Dummy.new(hash) }
  let(:options)  { { path: 'person', key: :id } }

  let(:hash) do
    {
      person: { id: 10 }
    }
  end

  describe '#build' do
    let(:fetcher) { builder.build(instance) }

    it do
      expect(fetcher).to be_a(Arstotzka::Fetcher)
    end

    it 'builds a fetcher capable of fetching' do
      expect(fetcher.fetch).to eq(10)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
arstotzka-1.6.2 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.6.1 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.6.0 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.5.0 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.4.4 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.4.3 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.4.2 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.4.1 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.4.0 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.3.2 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.3.1 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.3.0 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.2.4 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.2.3 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.2.2 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.2.1 spec/lib/arstotzka/fetcher_builder_spec.rb
arstotzka-1.2.0 spec/lib/arstotzka/fetcher_builder_spec.rb