Sha256: c5e3f37afc26f1ab1e49896d89a3a0428c6a80db68eb1ca932d00417cadeaab2

Contents?: true

Size: 666 Bytes

Versions: 8

Compression:

Stored size: 666 Bytes

Contents

require "spec/autorun"
require "watirspec"

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

8 entries across 8 versions & 1 rubygems

Version Path
watirspec-0.1.9.1 spec/spec_match_array_spec.rb
watirspec-0.1.8 spec/spec_match_array_spec.rb
watirspec-0.1.7 spec/spec_match_array_spec.rb
watirspec-0.1.6 spec/spec_match_array_spec.rb
watirspec-0.1.5 spec/spec_match_array_spec.rb
watirspec-0.1.4 spec/spec_match_array_spec.rb
watirspec-0.1.3 spec/spec_match_array_spec.rb
watirspec-0.1.2 spec/spec_match_array_spec.rb