passing rspec tests for type_spec.rb