Sha256: 518de0a94fccf120026d53d34bd3b360b08567a4bafe259887b30c6915589ab4

Contents?: true

Size: 1.45 KB

Versions: 16

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

module LedgerSync
  module Test
    module QA
      module LedgerHelpers
        def create_resource_for(*args)
          create_result_for(*args).raise_if_error.resource
        end

        def create_result_for(client:, resource:)
          result_for(
            client: client,
            method: :create,
            resource: resource
          )
        end

        def delete_resource_for(*args)
          delete_result_for(*args).raise_if_error.resource
        end

        def delete_result_for(client:, resource:)
          result_for(
            client: client,
            method: :delete,
            resource: resource
          )
        end

        def find_resource_for(*args)
          find_result_for(*args).raise_if_error.resource
        end

        def find_result_for(client:, resource:)
          result_for(
            client: client,
            method: :find,
            resource: resource
          )
        end

        def result_for(client:, method:, resource:)
          client.operation_for(
            method: method,
            resource: resource
          ).perform
        end

        def update_resource_for(*args)
          update_result_for(*args).raise_if_error.resource
        end

        def update_result_for(client:, resource:)
          result_for(
            client: client,
            method: :update,
            resource: resource
          )
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ledger_sync-2.6.0 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.5.0 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.4.4 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.3.1 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.2.3 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.2.1 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.2.0 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.0.2 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.0.1 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.0.0 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-2.0.0.pre.1 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-1.8.1 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-1.8.0 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-1.7.0 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-1.6.0 lib/ledger_sync/test/support/qa/ledger_helpers.rb
ledger_sync-1.5.2 lib/ledger_sync/test/support/qa/ledger_helpers.rb