Sha256: 92a07c46d1dffcf4d1f51d4e381efc2745b60e74c147faed415711ae8152f88a
Contents?: true
Size: 1.18 KB
Versions: 21
Compression:
Stored size: 1.18 KB
Contents
require 'sequel' Sequel::Model.db = Sequel.sqlite(':memory:') Sequel.extension :migration, :core_extensions require 'flipper/adapters/sequel' require 'generators/flipper/templates/sequel_migration' RSpec.describe Flipper::Adapters::Sequel do subject do described_class.new(feature_class: feature_class, gate_class: gate_class) end let(:feature_class) { Flipper::Adapters::Sequel::Feature } let(:gate_class) { Flipper::Adapters::Sequel::Gate } before(:each) do CreateFlipperTablesSequel.new(Sequel::Model.db).up feature_class.dataset = feature_class.dataset gate_class.dataset = gate_class.dataset end after(:each) do CreateFlipperTablesSequel.new(Sequel::Model.db).down end it_should_behave_like 'a flipper adapter' context 'requiring "flipper-sequel"' do before do Flipper.configuration = nil Flipper.instance = nil load 'flipper/adapters/sequel.rb' end it 'configures itself' do expect(Flipper.adapter.adapter).to be_a(Flipper::Adapters::Sequel) end it "defines #flipper_id on Sequel::Model" do expect(Sequel::Model.ancestors).to include(Flipper::Identifier) end end end
Version data entries
21 entries across 21 versions & 1 rubygems