Sha256: acfcf69cfcc0b42e6157b56265e5f98068cba0b3a6fba91020556f89e3c0b895

Contents?: true

Size: 1.1 KB

Versions: 45

Compression:

Stored size: 1.1 KB

Contents

require File.expand_path('watirspec/spec_helper', File.dirname(__FILE__))

describe Watir::Container do
  before { @container = Object.new.extend(Watir::Container) }

  describe "#extract_selector" do
    before do
      def @container.public_extract_selector(*args)
        extract_selector(*args)
      end
    end

    it "converts 2-arg selector into a hash" do
      @container.public_extract_selector([:how, 'what']).
                 should == { :how => 'what' }
    end

    it "returns the hash given" do
      @container.public_extract_selector([:how => "what"]).
                 should == { :how => "what" }
    end

    it "returns an empty hash if given no args" do
      @container.public_extract_selector([]).should == {}
    end

    it "raises ArgumentError if given 1 arg which is not a Hash" do
      lambda {
        @container.public_extract_selector([:how])
      }.should raise_error(ArgumentError)
    end

    it "raises ArgumentError if given > 2 args" do
      lambda {
        @container.public_extract_selector([:how, 'what', 'value'])
      }.should raise_error(ArgumentError)
    end

  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
watir-webdriver-0.6.4 spec/container_spec.rb
watir-webdriver-0.6.3 spec/container_spec.rb
watir-webdriver-0.6.2 spec/container_spec.rb
watir-webdriver-0.6.1 spec/container_spec.rb
watir-webdriver-0.6.0 spec/container_spec.rb
watir-webdriver-0.5.8 spec/container_spec.rb
watir-webdriver-0.5.7 spec/container_spec.rb
watir-webdriver-0.5.6 spec/container_spec.rb
watir-webdriver-0.5.5 spec/container_spec.rb
watir-webdriver-0.5.4 spec/container_spec.rb
watir-webdriver-0.5.3 spec/container_spec.rb
watir-webdriver-0.5.2 spec/container_spec.rb
watir-webdriver-0.5.1 spec/container_spec.rb
watir-webdriver-0.5.0 spec/container_spec.rb
watir-webdriver-0.4.1 spec/container_spec.rb
watir-webdriver-0.4.0 spec/container_spec.rb
watir-webdriver-0.3.9 spec/container_spec.rb
watir-webdriver-0.3.8 spec/container_spec.rb
watir-webdriver-0.3.7 spec/container_spec.rb
watir-webdriver-0.3.6 spec/container_spec.rb