2018-04-26 12:31:37 +03:00
|
|
|
require_relative "helper"
|
2015-05-17 14:38:25 +03:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
module Parfait
|
|
|
|
class TestObject < ParfaitTest
|
2015-05-17 14:38:25 +03:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
def setup
|
|
|
|
super
|
|
|
|
@object = ::Parfait::Object.new
|
|
|
|
end
|
2015-05-17 14:38:25 +03:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
def test_empty_object_doesnt_return
|
|
|
|
assert_nil @object.get_internal_word(3)
|
|
|
|
end
|
2015-05-17 14:38:25 +03:00
|
|
|
|
2018-04-26 12:31:37 +03:00
|
|
|
def test_one_set1
|
2018-05-14 11:55:01 +03:00
|
|
|
assert_equal @object.get_type , @object.set_internal_word(0, @object.get_type)
|
2018-04-26 12:31:37 +03:00
|
|
|
end
|
2015-10-26 12:22:32 +02:00
|
|
|
|
2019-02-12 22:41:42 +02:00
|
|
|
def test_type
|
2019-09-08 15:31:03 +03:00
|
|
|
assert_equal ::Parfait::Type , @object.get_internal_word( 0 ).class
|
2019-02-12 22:41:42 +02:00
|
|
|
end
|
2019-10-02 17:42:24 +03:00
|
|
|
def test_type_length
|
|
|
|
assert_equal 1 , Object.type_length
|
|
|
|
end
|
|
|
|
def test_set_type
|
|
|
|
type = @object.type
|
|
|
|
assert @object.set_type(type)
|
|
|
|
assert @object.type = type
|
|
|
|
end
|
|
|
|
def test_has_type
|
|
|
|
assert @object.has_type?
|
|
|
|
end
|
|
|
|
def test_set_inst
|
|
|
|
type = @object.type
|
|
|
|
assert @object.set_instance_variable(:type , type)
|
|
|
|
assert_equal type , @object.type
|
|
|
|
end
|
|
|
|
def test_names
|
|
|
|
assert_equal "[:type]" , @object.instance_variables.to_s
|
|
|
|
end
|
2018-04-26 12:31:37 +03:00
|
|
|
end
|
2015-05-17 14:38:25 +03:00
|
|
|
end
|