diff options
author | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-09-24 05:06:22 -0300 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2017-09-24 20:19:41 -0300 |
commit | bdd9f6f991e3a6dd5fbe4616cdd6303fa9416364 (patch) | |
tree | 7beb92de6ce238828a7a5604a34f994b176b2713 | |
parent | 76d2a31b8222b99ba2320a47dc256662c93ec1c7 (diff) | |
download | highline-bdd9f6f991e3a6dd5fbe4616cdd6303fa9416364.tar.gz |
Remove double negation
-rwxr-xr-x | lib/highline.rb | 6 | ||||
-rwxr-xr-x | lib/highline/question.rb | 4 | ||||
-rw-r--r-- | test/test_color_scheme.rb | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/highline.rb b/lib/highline.rb index e76c49d..7ab4d29 100755 --- a/lib/highline.rb +++ b/lib/highline.rb @@ -59,7 +59,7 @@ class HighLine # Returns +true+ if HighLine is currently using a color scheme. def using_color_scheme? - !!@color_scheme + true if @color_scheme end # Reset color scheme to default (+nil+) @@ -126,7 +126,7 @@ class HighLine # Returns truethy if HighLine instance is currently using color escapes. def use_color? - !!use_color + use_color end # Resets the use of color. @@ -139,7 +139,7 @@ class HighLine # Returns true if HighLine is currently tracking EOF for input. def track_eof? - !!track_eof + true if track_eof end # @return [Integer] The current column setting for wrapping output. diff --git a/lib/highline/question.rb b/lib/highline/question.rb index f6cccfb..d94df9a 100755 --- a/lib/highline/question.rb +++ b/lib/highline/question.rb @@ -393,7 +393,7 @@ class HighLine # Returns true if _first_answer_ is set. def first_answer? - !!@first_answer + true if @first_answer end # @@ -579,7 +579,7 @@ class HighLine if echo == true response # any truethy value, probably a String - elsif !!echo + elsif echo echo # any falsy value, false or nil else diff --git a/test/test_color_scheme.rb b/test/test_color_scheme.rb index d29d863..0040790 100644 --- a/test/test_color_scheme.rb +++ b/test/test_color_scheme.rb @@ -22,10 +22,10 @@ class TestColorScheme < Minitest::Test end def test_using_color_scheme - assert_equal(false, HighLine.using_color_scheme?) + refute(HighLine.using_color_scheme?) HighLine.color_scheme = HighLine::ColorScheme.new - assert_equal(true, HighLine.using_color_scheme?) + assert(true, HighLine.using_color_scheme?) end def test_scheme |