All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gems.virtus-1.0.5.spec.shared.options_class_method.rb Maven / Gradle / Ivy

The newest version!
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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy