diff options
author | Tim Smith <tsmith@chef.io> | 2017-02-09 17:58:24 +0000 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-02-09 17:58:24 +0000 |
commit | df8d766407ac33d765fc3e2c969b217d5c6242ad (patch) | |
tree | da864960a44da977176eb22784b42542bda2e9b7 /spec/support/chef_helpers.rb | |
parent | b9ec59f8dfd92e7b70b54dd890f949a5e5e1e4a6 (diff) | |
download | chef-remove_old_ruby.tar.gz |
Remove Ruby 1.8/1.9 code from the specsremove_old_ruby
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/support/chef_helpers.rb')
-rw-r--r-- | spec/support/chef_helpers.rb | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/spec/support/chef_helpers.rb b/spec/support/chef_helpers.rb index d0b5ad0bfd..a45b9faa70 100644 --- a/spec/support/chef_helpers.rb +++ b/spec/support/chef_helpers.rb @@ -29,26 +29,6 @@ def sha256_checksum(path) OpenSSL::Digest::SHA256.hexdigest(File.read(path)) end -# From Ruby 1.9.2+ -# Here for backwards compatibility with Ruby 1.8.7 -# http://rubydoc.info/stdlib/tmpdir/1.9.2/Dir/Tmpname -def make_tmpname(prefix_suffix, n = nil) - case prefix_suffix - when String - prefix = prefix_suffix - suffix = "" - when Array - prefix = prefix_suffix[0] - suffix = prefix_suffix[1] - else - raise ArgumentError, "unexpected prefix_suffix: #{prefix_suffix.inspect}" - end - t = Time.now.strftime("%Y%m%d") - path = "#{prefix}#{t}-#{$$}-#{rand(0x100000000).to_s(36)}" - path << "-#{n}" if n - path << suffix -end - # NOTE: # This is a temporary fix to get tests passing on systems that have no `diff` # until we can replace shelling out to `diff` with ruby diff-lcs |