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:
Torsten Ruger
2015-05-18 10:47:29 +03:00
parent f7eb888c36
commit cfc2c474b2
9 changed files with 86 additions and 25 deletions

View 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

View File

@ -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