Sha256: df358b6b67b88e20b7c9cc4e332ab540921a64b473fe14070af70cab24001605

Contents?: true

Size: 460 Bytes

Versions: 10

Compression:

Stored size: 460 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(default).to(value)
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
virtus-0.5.5 spec/shared/options_class_method.rb
virtus-0.5.4 spec/shared/options_class_method.rb
virtus-0.5.3 spec/shared/options_class_method.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/shared/options_class_method.rb
virtus-0.5.2 spec/shared/options_class_method.rb
virtus-0.5.1 spec/shared/options_class_method.rb
virtus-0.5.0 spec/shared/options_class_method.rb
virtus-0.4.2 spec/shared/options_class_method.rb
virtus-0.4.1 spec/shared/options_class_method.rb
virtus-0.4.0 spec/shared/options_class_method.rb