Sha256: cae8b1da9dcdb7e4f7030f9f0e70eebf40c9b4cfab40bdeabd242581d8df3970

Contents?: true

Size: 456 Bytes

Versions: 3

Compression:

Stored size: 456 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) { stub('value') }

    it { should equal(object) }

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
virtus-0.3.0 spec/shared/options_class_method.rb
virtus-0.2.0 spec/shared/options_class_method.rb
virtus-0.1.0 spec/shared/options_class_method.rb