Sha256: 56a8b1c7dd7772951b8afe46770b6d034a1a0a546a34e8fc8aaabedb3b0cc6cd

Contents?: true

Size: 956 Bytes

Versions: 6

Compression:

Stored size: 956 Bytes

Contents

#---
# Excerpted from "Scripted GUI Testing With Ruby",
# published by The Pragmatic Bookshelf.
# Copyrights apply to this code. It may not be used to create training material, 
# courses, books, articles, and the like. Contact us if you are in doubt.
# We make no guarantees that this code is fit for any purpose. 
# Visit http://www.pragmaticprogrammer.com/titles/idgtr for more book information.
#---

require 'windows_gui'

describe WindowsGui do                       #(1)
  include WindowsGui
  
  it 'wraps a Windows call with a method' do
    find_window(nil, nil).should_not == 0    #(2)
  end

  it 'enforces the argument count' do
    lambda {find_window}.should raise_error  #(3)
  end
end




describe String, '#snake_case' do
  it 'transforms CamelCase strings' do
    'GetCharWidth32'.snake_case.should == 'get_char_width_32'
  end
  
  it 'leaves snake_case strings intact' do
    'keybd_event'.snake_case.should == 'keybd_event'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
win_gui-0.1.6 book_code/simplify/windows_gui_spec.rb
win_gui-0.1.4 book_code/simplify/windows_gui_spec.rb
win_gui-0.1.3 book_code/simplify/windows_gui_spec.rb
win_gui-0.1.2 book_code/simplify/windows_gui_spec.rb
win_gui-0.1.1 book_code/simplify/windows_gui_spec.rb
win_gui-0.1.0 book_code/simplify/windows_gui_spec.rb