Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug corrections in types

  • Loading branch information...
commit 4ba8b6a3638cddf52e5d3914fb2ef942638dc3b4 1 parent ff4283f
@glejeune authored
View
2  lib/graphviz/types/gv_bool.rb
@@ -5,7 +5,7 @@ class BoolException < RuntimeError
#
# For the bool type,
# - TRUE values are represented by "true" or "yes" (case-insensitive), true and any non-zero integer
-# - FALSE values by "false" or "no" (case-insensitive), false and zero.
+# - FALSE values by "false", "no" or empty string (case-insensitive), false and zero.
#
# Example
#
View
3  lib/graphviz/types/spline_type.rb
@@ -35,9 +35,10 @@ def check(data)
@is_spline = false
return data
end
+ return nil if data.empty?
+
raise SplineTypeException, "Invalid spline type value"
end
- return nil if data.empty?
def output
return @data.to_s.inspect.gsub( "\\\\", "\\" )
View
8 test/test_types.rb
@@ -55,11 +55,13 @@ def test_gv_bool
assert_equal false, bool.to_ruby
assert_raise BoolException, "Wrong bool value" do
- GraphViz::Types::GvBool.new("toto")
+ GraphViz::Types::GvBool.new(:toto)
end
- assert_raise BoolException, "Wrong bool value" do
- GraphViz::Types::GvBool.new("")
+ assert_block "Create GvBool with empty string failed." do
+ bool = GraphViz::Types::GvBool.new("")
end
+ assert bool
+ assert_equal false, bool.to_ruby
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.