test compatibility layer
test from and to std/parfait objects for list and word for now moved some of that code to virtual, out of parfait
This commit is contained in:
19
test/virtual/test_compat.rb
Normal file
19
test/virtual/test_compat.rb
Normal file
@ -0,0 +1,19 @@
|
||||
require_relative "../helper"
|
||||
|
||||
|
||||
class TestCompat < MiniTest::Test
|
||||
|
||||
def test_list_create_from_array
|
||||
array = [1,2,3]
|
||||
list = Virtual.new_list(array)
|
||||
assert_equal list , Virtual.new_list(array)
|
||||
assert_equal array , list.to_a
|
||||
end
|
||||
|
||||
def test_word_create_from_string
|
||||
string = "something"
|
||||
word = Virtual.new_word(string)
|
||||
assert_equal word , Virtual.new_word(string)
|
||||
assert_equal string , word.to_s
|
||||
end
|
||||
end
|
@ -50,8 +50,8 @@ class TestConversion < MiniTest::Test
|
||||
|
||||
def test_string
|
||||
string = "hello"
|
||||
word = Parfait.new_word string
|
||||
assert_equal word , Parfait.new_word(string)
|
||||
word = Virtual.new_word string
|
||||
assert_equal word , Virtual.new_word(string)
|
||||
assert_equal string , word.to_s
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user