Sha256: b04571c829d56ccce6082b596133a53271c58af49f758f8b7e3fab983a3441a2

Contents?: true

Size: 619 Bytes

Versions: 11

Compression:

Stored size: 619 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
watirsplash-1.4.3 spec/spec_match_array_spec.rb
watirsplash-1.4.2 spec/spec_match_array_spec.rb
watirsplash-1.4.1 spec/spec_match_array_spec.rb
watirsplash-1.4.0 spec/spec_match_array_spec.rb
watirsplash-1.3.0 spec/spec_match_array_spec.rb
watirsplash-1.2.1 spec/spec_match_array_spec.rb
watirsplash-1.2.0 spec/spec_match_array_spec.rb
watirsplash-1.1.2 spec/spec_match_array_spec.rb
watirsplash-1.1.1 spec/spec_match_array_spec.rb
watirsplash-1.1.0 spec/spec_match_array_spec.rb
watirsplash-1.0.0 spec/spec_match_array_spec.rb