Sha256: a4777e266ea7b587ce38783d50016b59db8b0150396f495ef6131b89f2fe4dd1
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 KB
Contents
# frozen_string_literal: true module Grape module DSL module CallbacksSpec class Dummy include Grape::DSL::Callbacks end end describe Callbacks do subject { Class.new(CallbacksSpec::Dummy) } let(:proc) { -> {} } describe '.before' do it 'adds a block to "before"' do expect(subject).to receive(:namespace_stackable).with(:befores, proc) subject.before(&proc) end end describe '.before_validation' do it 'adds a block to "before_validation"' do expect(subject).to receive(:namespace_stackable).with(:before_validations, proc) subject.before_validation(&proc) end end describe '.after_validation' do it 'adds a block to "after_validation"' do expect(subject).to receive(:namespace_stackable).with(:after_validations, proc) subject.after_validation(&proc) end end describe '.after' do it 'adds a block to "after"' do expect(subject).to receive(:namespace_stackable).with(:afters, proc) subject.after(&proc) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
grape-1.8.0 | spec/grape/dsl/callbacks_spec.rb |
grape-1.7.1 | spec/grape/dsl/callbacks_spec.rb |
grape-1.7.0 | spec/grape/dsl/callbacks_spec.rb |