Sha256: eb528bf307004ad4bfff49b1f249bb3f07c8b35b4582a6b96973657888c0980e

Contents?: true

Size: 637 Bytes

Versions: 14

Compression:

Stored size: 637 Bytes

Contents

require "spec"

describe "Array match_array matcher" do

  it "matches other arrays with regexps" do
    expected_ary = ["1", "2", "3", /\d/]
    ["1", "2", "3", "5"].should match_array(expected_ary)

    expected_ary = ["1", ["2", /\d+/], /3/]
    ["1", [], "4"].should_not match_array(expected_ary)
    ["1", ["2", "55"], "3"].should match_array(expected_ary)
  end

  it "doesn't work with other objects than Array" do
    lambda {"".should match_array("")}.should raise_exception
    lambda {[].should match_array("")}.should raise_exception
    lambda {"".should match_array([])}.should raise_exception
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
watirsplash-0.2.14 spec/spec_match_array_spec.rb
watirsplash-0.2.12 spec/spec_match_array_spec.rb
watirsplash-0.2.11 spec/spec_match_array_spec.rb
watirsplash-0.2.10 spec/spec_match_array_spec.rb
watirsplash-0.2.9 spec/spec_match_array_spec.rb
watirsplash-0.2.8 spec/spec_match_array_spec.rb
watirsplash-0.2.7 spec/spec_match_array_spec.rb
watirsplash-0.2.6 spec/spec_match_array_spec.rb
watirsplash-0.2.5 spec/spec_match_array_spec.rb
watirsplash-0.2.4 spec/spec_match_array_spec.rb
watirsplash-0.2.3 spec/spec_match_array_spec.rb
watirsplash-0.2.2 spec/spec_match_array_spec.rb
watirsplash-0.2.1 spec/spec_match_array_spec.rb
watirsplash-0.2.0 spec/spec_match_array_spec.rb