test/helper.rb in cap-util-1.5.1 vs test/helper.rb in cap-util-1.5.2
- old
+ new
@@ -7,9 +7,18 @@
# require pry for debugging (`binding.pry`)
require 'pry'
require 'test/support/factory'
+# 1.8.7 backfills
+
+# Array#sample
+if !(a = Array.new).respond_to?(:sample) && a.respond_to?(:choice)
+ class Array
+ alias_method :sample, :choice
+ end
+end
+
ENV['CAPUTIL_SILENCE_SAY'] = 'yes'
require 'cap-util'
require 'cap-util/fake_cap'