puppetlabs-stdlib/spec/unit/puppet/parser/functions
Jeff McCune b7a59a8095 (#11901) Fix sort order error in tests for 'keys' and 'values'
Between Ruby 1.8.7 p352 and p357 the way arrays were returned when using
keys and values in Ruby changed, and due to assumption about the
ordering our tests are now failing.

This patch fixes the issue by using the =~ operator matcher in rspec.
This matcher is implemented as RSpec::Matchers::MatchArray and performs
multiset equality matching of arrays.  Order doesn't matter, but
duplicate values do.

This patch also switches @scope instance variables to memoized let
methods for clarity in the code.

Original Author: Ken Barber
Reviewed-by: Nick Lewis

This commit closes GH-29
2012-01-11 17:39:15 -08:00
..
abs_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
bool2num_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
capitalize_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
chomp_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
chop_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
delete_at_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
delete_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
downcase_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
empty_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
flatten_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
getvar_spec.rb (#8010) Add getvar() rvalue function 2011-06-21 15:12:46 -07:00
grep_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
has_key_spec.rb (#8708) Add has_key function 2011-07-29 15:11:10 -07:00
hash_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_array_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_domain_name_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_float_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_hash_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_integer_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_ip_address_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_mac_address_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_numeric_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
is_string_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
join_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
keys_spec.rb (#11901) Fix sort order error in tests for 'keys' and 'values' 2012-01-11 17:39:15 -08:00
lstrip_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
member_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
merge_spec.rb (#8709) Add hash merging function 2011-07-29 15:28:21 -07:00
num2bool_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
parsejson_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
parseyaml_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
prefix_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
range_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
reverse_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
rstrip_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
shuffle_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
size_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
sort_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
squeeze_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
str2bool_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
strftime_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
strip_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
swapcase_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
time_spec.rb (#11873) time function spec failure on Fixnum matcher 2012-01-10 18:58:07 +00:00
type_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
unique_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
upcase_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
validate_array_spec.rb (#8678) Add validate_array and validate_string functions 2011-08-04 16:05:39 -07:00
validate_bool_spec.rb Add additional tests to validate_bool() spec 2011-06-03 11:56:02 -07:00
validate_hash_spec.rb (#8010) Add validate_hash spec tests 2011-06-21 17:02:22 -07:00
validate_string_spec.rb (#8678) Add validate_array and validate_string functions 2011-08-04 16:05:39 -07:00
values_at_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00
values_spec.rb (#11901) Fix sort order error in tests for 'keys' and 'values' 2012-01-11 17:39:15 -08:00
zip_spec.rb * Moved kwalify to puppetlabs-kwalify project 2011-08-05 08:46:38 +01:00