Sha256: 82e7b964f062ac817862ad2ed2c2b4ab9e4c03104695ccd96ecd60540fb911ef

Contents?: true

Size: 476 Bytes

Versions: 15

Compression:

Stored size: 476 Bytes

Contents

shared_examples_for 'an options class method' do
  context 'with no argument' do
    subject { object.send(method) }

    it { is_expected.to be(default) }
  end

  context 'with a default value' do
    subject { object.send(method, value) }

    let(:value) { mock('value') }

    it { is_expected.to equal(object) }

    it 'sets the default value for the class method' do
      expect { subject }.to change { object.send(method) }.from(default).to(value)
    end
  end
end

Version data entries

15 entries across 13 versions & 5 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/spec/shared/options_class_method.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/spec/shared/options_class_method.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/virtus-2.0.0/spec/shared/options_class_method.rb
virtus2-2.1.0 spec/shared/options_class_method.rb
virtus2-2.0.2 spec/shared/options_class_method.rb
virtus2-2.0.1 spec/shared/options_class_method.rb
virtus-2.0.0 spec/shared/options_class_method.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/virtus-1.0.5/spec/shared/options_class_method.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/virtus-1.0.5/spec/shared/options_class_method.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/spec/shared/options_class_method.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/spec/shared/options_class_method.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/spec/shared/options_class_method.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/spec/shared/options_class_method.rb
virtus-1.0.5 spec/shared/options_class_method.rb
virtus-1.0.4 spec/shared/options_class_method.rb