add test for new feature
This commit is contained in:
parent
c48b7a3403
commit
778d751c55
31
test/test_ext.rb
Normal file
31
test/test_ext.rb
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
require_relative "helper"
|
||||||
|
|
||||||
|
class FailValue
|
||||||
|
def initialize str
|
||||||
|
@name = str
|
||||||
|
end
|
||||||
|
def is_value?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
class BasicValue < FailValue
|
||||||
|
def to_sof
|
||||||
|
"'#{@name}'"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class ObjectSof < MiniTest::Test
|
||||||
|
include Checker
|
||||||
|
|
||||||
|
def test_to_sof
|
||||||
|
assert_raises NoMethodError do
|
||||||
|
Sof::Writer.write(FailValue.new("name"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_basic
|
||||||
|
@out = Sof::Writer.write(BasicValue.new("name"))
|
||||||
|
check "'name'"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user