summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-10-27 10:51:51 -0700
committerTim Smith <tsmith84@gmail.com>2020-10-27 10:51:51 -0700
commit5122f9f77f89ba026e77b36062b70b241c552792 (patch)
tree75a930f73e58e84a91707b10d86148af8b1a55a8 /spec/support
parentb3dbca14e1b587f4367acf082392fb3aea7bb872 (diff)
downloadchef-5122f9f77f89ba026e77b36062b70b241c552792.tar.gz
Merge repetitive conditionals
So much easier to read and probably faster this way too. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/lib/chef/resource/cat.rb2
-rw-r--r--spec/support/lib/chef/resource/one_two_three_four.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/spec/support/lib/chef/resource/cat.rb b/spec/support/lib/chef/resource/cat.rb
index a66aef8e19..f81504d167 100644
--- a/spec/support/lib/chef/resource/cat.rb
+++ b/spec/support/lib/chef/resource/cat.rb
@@ -29,7 +29,7 @@ class Chef
end
def pretty_kitty(arg = nil)
- if arg == true || arg == false
+ if [true, false].include?(arg)
@pretty_kitty = arg
end
@pretty_kitty
diff --git a/spec/support/lib/chef/resource/one_two_three_four.rb b/spec/support/lib/chef/resource/one_two_three_four.rb
index 4dcbf1e60b..da95d329f5 100644
--- a/spec/support/lib/chef/resource/one_two_three_four.rb
+++ b/spec/support/lib/chef/resource/one_two_three_four.rb
@@ -26,7 +26,7 @@ class Chef
end
def something(arg = nil)
- if arg == true || arg == false
+ if [true, false].include?(arg)
@something = arg
end
@something