Sha256: 430e1fcabf45948c084172ee290902e7e47bd6b0c0e066cd01bc570297d6764c

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

require 'spec_helper'

describe Virtus::Attribute::DefaultValue, '.new' do
  subject { described_class.new(attribute, value) }

  let(:attribute) { Virtus::Attribute::String.new(:attribute) }

  context 'with a value that can be duped' do
    let(:value) { 'something' }

    its(:value) { should     eql(value)   }
    its(:value) { should_not equal(value) }
  end

  context 'with a value that cannot be duped' do
    [ nil, true, false, 1, :symbol ].each do |value|
      context "with #{value.inspect}" do
        let(:value) { value }

        its(:value) { should equal(value) }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
virtus-0.0.9 spec/unit/virtus/attribute/default_value/class_methods/new_spec.rb
virtus-0.0.8 spec/unit/virtus/attribute/default_value/class_methods/new_spec.rb
virtus-0.0.7 spec/unit/virtus/attribute/default_value/class_methods/new_spec.rb