Sha256: c89fd9af0a693f3b8c776434bef447e7a8d5c5081a4b6960d54d478b991e3e17
Contents?: true
Size: 933 Bytes
Versions: 16
Compression:
Stored size: 933 Bytes
Contents
# frozen_string_literal: true RSpec.shared_examples 'a valid operation' do it 'is valid' do instance = described_class.new(resource: resource, client: client) if ENV.fetch('DEBUG', false) && !instance.valid? pd instance.errors byebug if ENV['DEBUG'] # rubocop:disable Lint/Debugger end expect(instance).to be_valid end end RSpec.shared_examples 'a successful operation' do |stubs: []| before do stubs = Array(stubs) stubs.each do |stub| if stub.is_a?(Array) send(*stub) else send(stub) end end end it 'is successful' do result = described_class.new(resource: resource, client: client).perform byebug if ENV.fetch('DEBUG', false) && result.failure? # rubocop:disable Lint/Debugger expect(result).to be_a(LedgerSync::OperationResult::Success) end end RSpec.shared_examples 'an operation' do it_behaves_like 'a valid operation' end
Version data entries
16 entries across 16 versions & 1 rubygems