No release in over 3 years
Spec helpers for crud driver projects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0
>= 0.2.0, < 2.0.0
 Project Readme

CRUD Driver Spec Helpers

This gem can be used by developers of Foobara CRUD drivers to ensure adherence to the CRUD Driver interface.

Installation

Add gem "foobara-crud-driver-spec-helpers" to the :test group of your Gemfile.

Usage

In a spec file, you can do something like:

require "foobara/spec_helpers/it_behaves_like_a_crud_driver"

RSpec.describe Foobara::SomeCrudDriver do
  after { Foobara.reset_alls }

  let(:crud_driver) { described_class.new }

  before do
    Foobara::Persistence.default_crud_driver = crud_driver
  end

  it_behaves_like_a_crud_driver
end

NOTE: If you are using a crud driver that requires strong typing, like the foobara-postgresql-crud-driver, you will need to create the tables needed in a before block. See that gem's spec for an example.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/foobara/crud-driver-spec-helpers

License

This project is licensed under the MPL-2.0 license. Please see LICENSE.txt for more info.