rspec/rspec-expectations — pull request #186 by samphippen (2012-10-26 16:30:04+00:00)
Title: Improve the match_array failure message when a non-array object is passed

Related to #185

I've fixed this up, by checking if the passed object returns true from `is_a? Array` otherwise an error message is given stating that the object isn't an array.

Also for some reason I've got a failing spec on my local computer (both master and this branch):

```ruby
/Users/sam/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -w -S rspec ./spec/rspec/expectations/differ_spec.rb ./spec/rspec/expectations/expectation_target_spec.rb ./spec/rspec/expectations/extensions/kernel_spec.rb ./spec/rspec/expectations/fail_with_spec.rb ./spec/rspec/expectations/handler_spec.rb ./spec/rspec/expectations/syntax_spec.rb ./spec/rspec/matchers/base_matcher_spec.rb ./spec/rspec/matchers/be_close_spec.rb ./spec/rspec/matchers/be_instance_of_spec.rb ./spec/rspec/matchers/be_kind_of_spec.rb ./spec/rspec/matchers/be_spec.rb ./spec/rspec/matchers/be_within_spec.rb ./spec/rspec/matchers/change_spec.rb ./spec/rspec/matchers/configuration_spec.rb ./spec/rspec/matchers/cover_spec.rb ./spec/rspec/matchers/description_generation_spec.rb ./spec/rspec/matchers/dsl_spec.rb ./spec/rspec/matchers/eq_spec.rb ./spec/rspec/matchers/eql_spec.rb ./spec/rspec/matchers/equal_spec.rb ./spec/rspec/matchers/exist_spec.rb ./spec/rspec/matchers/has_spec.rb ./spec/rspec/matchers/have_spec.rb ./spec/rspec/matchers/include_spec.rb ./spec/rspec/matchers/match_array_spec.rb ./spec/rspec/matchers/match_spec.rb ./spec/rspec/matchers/matcher_spec.rb ./spec/rspec/matchers/matchers_spec.rb ./spec/rspec/matchers/method_missing_spec.rb ./spec/rspec/matchers/operator_matcher_spec.rb ./spec/rspec/matchers/raise_error_spec.rb ./spec/rspec/matchers/respond_to_spec.rb ./spec/rspec/matchers/satisfy_spec.rb ./spec/rspec/matchers/start_with_end_with_spec.rb ./spec/rspec/matchers/throw_symbol_spec.rb ./spec/rspec/matchers/yield_spec.rb
Run options: include {:focused=>true}

All examples were filtered out; ignoring {:focused=>true}
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F........................................................................................................................................................................................................................................................................................................................................

Failures:

1) RSpec::Matchers::Configuration#backtrace_formatter defaults to a null formatter when rspec-core is not loaded
Failure/Error: hide_const("RSpec::Core::BacktraceFormatter")
NoMethodError:
undefined method `hide_const' for #
# ./lib/rspec/matchers/method_missing.rb:9:in `method_missing'
# ./spec/rspec/matchers/configuration_spec.rb:34:in `block (3 levels) in '
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example.rb:114:in `instance_eval'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example.rb:114:in `block in run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example.rb:254:in `with_around_each_hooks'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example.rb:111:in `run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example_group.rb:388:in `block in run_examples'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example_group.rb:384:in `map'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example_group.rb:384:in `run_examples'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example_group.rb:369:in `run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example_group.rb:370:in `block in run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example_group.rb:370:in `map'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/example_group.rb:370:in `run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/command_line.rb:28:in `map'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/command_line.rb:28:in `block in run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/reporter.rb:34:in `report'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/command_line.rb:25:in `run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/runner.rb:69:in `run'
# /Users/sam/dev/rspec/rspec-core/lib/rspec/core/runner.rb:8:in `block in autorun'

Finished in 0.28982 seconds
810 examples, 1 failure

Failed examples:

rspec ./spec/rspec/matchers/configuration_spec.rb:33 # RSpec::Matchers::Configuration#backtrace_formatter defaults to a null formatter when rspec-core is not loaded

Randomized with seed 26263

```