summaryrefslogtreecommitdiff
path: root/test/test_string_extension.rb
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2017-07-07 05:24:23 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2017-07-07 05:31:51 -0300
commit8e9b826acfe47b049b3376ea1b2b9fd51c60e2e0 (patch)
tree2e685caea0f5067d7f260bd596f9c264b203bc85 /test/test_string_extension.rb
parent653dd52f6f8a90d3a43cdd0a76d6221050b9d3f4 (diff)
downloadhighline-8e9b826acfe47b049b3376ea1b2b9fd51c60e2e0.tar.gz
Use guard clauses (rubocop warning)
Diffstat (limited to 'test/test_string_extension.rb')
-rw-r--r--test/test_string_extension.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/test_string_extension.rb b/test/test_string_extension.rb
index 8f97dbe..44b514e 100644
--- a/test/test_string_extension.rb
+++ b/test/test_string_extension.rb
@@ -35,18 +35,18 @@ class TestStringExtension < Minitest::Test
def test_Highline_String_is_yaml_serializable
require "yaml"
- unless Gem::Version.new(YAML::VERSION) < Gem::Version.new("2.0.2")
- highline_string =
- HighLine::String.new("Yaml didn't messed with HighLine::String")
- yaml_highline_string = highline_string.to_yaml
- yaml_loaded_string =
- YAML.safe_load(yaml_highline_string, [HighLine::String])
+ return if Gem::Version.new(YAML::VERSION) < Gem::Version.new("2.0.2")
- assert_equal "Yaml didn't messed with HighLine::String",
- yaml_loaded_string
- assert_equal highline_string, yaml_loaded_string
- assert_instance_of HighLine::String, yaml_loaded_string
- end
+ highline_string =
+ HighLine::String.new("Yaml didn't messed with HighLine::String")
+ yaml_highline_string = highline_string.to_yaml
+ yaml_loaded_string =
+ YAML.safe_load(yaml_highline_string, [HighLine::String])
+
+ assert_equal "Yaml didn't messed with HighLine::String",
+ yaml_loaded_string
+ assert_equal highline_string, yaml_loaded_string
+ assert_instance_of HighLine::String, yaml_loaded_string
end
def test_highline_string_respond_to_color