Sha256: 9ff750c7dc79703c3d1f3845d36e59dd46a70361ef1c6bc1fec170d3a9a0843e

Contents?: true

Size: 1.28 KB

Versions: 21

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'

describe "Win32::ListBox", :if => SpecHelper.adapter == :win_32 do

  it "#exists" do
    RAutomation::Window.new(:title => "MainFormWindow").list_box(:index => 0).should exist
  end

  it "#count" do
    list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:index => 0)
    list_box.count.should == 3
  end

  it "lists items" do
    list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:index => 0)
    list_box.items[0].should == "Apple"
    list_box.items[1].should == "Orange"
    list_box.items[2].should == "Mango"
  end

  it "#selected?" do
    list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:index => 0)
    list_box.should_not be_selected(2)
    list_box.select(2)
    list_box.should be_selected(2)
  end

  it "#select" do
    list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:index => 0)
    list_box.select(1)
    list_box.should be_selected(1)
    list_box.select(0)
    list_box.should be_selected(0)
    list_box.select(2)
    list_box.should be_selected(2)
  end

  it "#strings" do
    list_box = RAutomation::Window.new(:title => "MainFormWindow").list_box(:index => 0)
    list_box.strings.should == ["Apple", "Orange", "Mango"]
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rautomation-1.1.0 spec/adapter/win_32/listbox_spec.rb
rautomation-1.0.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.17.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.16.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.15.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.14.1 spec/adapter/win_32/listbox_spec.rb
rautomation-0.14.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.13.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.12.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.11.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.10.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.9.4 spec/adapter/win_32/listbox_spec.rb
rautomation-0.9.3 spec/adapter/win_32/listbox_spec.rb
rautomation-0.9.2 spec/adapter/win_32/listbox_spec.rb
rautomation-0.9.1 spec/adapter/win_32/listbox_spec.rb
rautomation-0.9.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.8.0 spec/adapter/win_32/listbox_spec.rb
rautomation-0.7.3 spec/adapter/win_32/listbox_spec.rb
rautomation-0.7.2 spec/adapter/win_32/listbox_spec.rb
rautomation-0.7.1 spec/adapter/win_32/listbox_spec.rb