Sha256: e173689986785fa1588a77ba19a7c021fdb6451ae749a853338d6442554d7327

Contents?: true

Size: 462 Bytes

Versions: 12

Compression:

Stored size: 462 Bytes

Contents

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

    it { should be(default) }
  end

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

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

    it { should 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

12 entries across 12 versions & 1 rubygems

Version Path
virtus-1.0.3 spec/shared/options_class_method.rb
virtus-1.0.2 spec/shared/options_class_method.rb
virtus-1.0.1 spec/shared/options_class_method.rb
virtus-1.0.0 spec/shared/options_class_method.rb
virtus-1.0.0.rc2 spec/shared/options_class_method.rb
virtus-1.0.0.rc1 spec/shared/options_class_method.rb
virtus-1.0.0.beta8 spec/shared/options_class_method.rb
virtus-1.0.0.beta7 spec/shared/options_class_method.rb
virtus-1.0.0.beta6 spec/shared/options_class_method.rb
virtus-1.0.0.beta5 spec/shared/options_class_method.rb
virtus-1.0.0.beta4 spec/shared/options_class_method.rb
virtus-1.0.0.beta3 spec/shared/options_class_method.rb