Sha256: 3c0441dc13ba2b0c8e4bb55f3c5286ee9c05bdcce30ec250d5ddc35c9f2a279e

Contents?: true

Size: 430 Bytes

Versions: 8

Compression:

Stored size: 430 Bytes

Contents

# frozen_string_literal: true

RSpec.shared_context 'skip if' do
  around do |spec|
    if current_adapter == adapter
      spec.skip
    else
      spec.run
    end
  end
end

RSpec.shared_context 'skip unless' do
  around do |spec|
    if current_adapter != adapter
      spec.skip
    else
      spec.run
    end
  end
end

def current_adapter(model_class = ActiveRecord::Base)
  DeclareSchema.current_adapter(model_class)
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
declare_schema-2.3.1 spec/support/adapter_specific_test_helpers.rb
declare_schema-2.3.0 spec/support/adapter_specific_test_helpers.rb
declare_schema-2.3.0.pre.is.0 spec/support/adapter_specific_test_helpers.rb
declare_schema-2.2.1 spec/support/adapter_specific_test_helpers.rb
declare_schema-2.2.0.colin.1 spec/support/adapter_specific_test_helpers.rb
declare_schema-2.2.0 spec/support/adapter_specific_test_helpers.rb
declare_schema-2.1.0 spec/support/adapter_specific_test_helpers.rb
declare_schema-2.1.0.pre.1 spec/support/adapter_specific_test_helpers.rb