Sha256: cd48d63138805d41d7be0353f7f2d617d4b206fcf3695e1c68a99326a92c5372

Contents?: true

Size: 488 Bytes

Versions: 9

Compression:

Stored size: 488 Bytes

Contents

$: << File.expand_path(File.dirname(__FILE__) + '/../lib')

require 'rubygems'
require 'test/unit'
require 'valuable.rb'
require 'mocha'

class Person < Valuable
  has_value :first_name
  has_value :last_name

  def initialize(atts={})
    self.first_name = "Joe"
    super(atts)
  end
end

class ParseWithTest < Test::Unit::TestCase
 
  def test_that_attributes_are_accessible_in_custom_constructor
    assert_nothing_raised do
      Person.new(:last_name => 'Smith')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
valuable-0.9.12 test/custom_initializer_test.rb
valuable-0.9.11 test/custom_initializer_test.rb
valuable-0.9.10 test/custom_initializer_test.rb
valuable-0.9.9 test/custom_initializer_test.rb
valuable-0.9.8 test/custom_initializer_test.rb
valuable-0.9.7 test/custom_initializer_test.rb
valuable-0.9.6 test/custom_initializer_test.rb
valuable-0.9.5 test/custom_initializer_test.rb
valuable-0.9.4 test/custom_initializer_test.rb