Skip to content

Commit 1545015

Browse files
committed
rb: Remove \t from source. Are we barbarians?
1 parent dd422b8 commit 1545015

File tree

5 files changed

+63
-66
lines changed

5 files changed

+63
-66
lines changed

rb/lib/selenium/client/base.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
module Selenium
2121
module Client
2222

23-
# Driver constructor and session management commands
23+
# Driver constructor and session management commands
2424
module Base
2525
include Selenium::Client::Protocol
2626
include Selenium::Client::GeneratedDriver
@@ -133,7 +133,7 @@ def start(opts = {})
133133
end
134134

135135
def stop
136-
close_current_browser_session
136+
close_current_browser_session
137137
end
138138

139139
def chrome_backend?
@@ -143,7 +143,7 @@ def chrome_backend?
143143
def javascript_extension=(new_javascript_extension)
144144
@extension_js = new_javascript_extension
145145
end
146-
alias :set_extension_js :javascript_extension=
146+
alias :set_extension_js :javascript_extension=
147147

148148
end
149149

rb/lib/selenium/client/extensions.rb

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,19 @@ module Client
2323
# Convenience methods not explicitly part of the protocol
2424
module Extensions
2525

26-
# These for all Ajax request to finish (Only works if you are using prototype, the wait happens in the browser)
27-
#
26+
# These for all Ajax request to finish (Only works if you are using prototype, the wait happens in the browser)
2827
def wait_for_ajax(options={})
29-
builder = JavascriptExpressionBuilder.new active_javascript_framework(options)
30-
wait_for_condition builder.no_pending_ajax_requests.script,
31-
options[:timeout_in_seconds]
28+
builder = JavascriptExpressionBuilder.new active_javascript_framework(options)
29+
wait_for_condition builder.no_pending_ajax_requests.script, options[:timeout_in_seconds]
3230
end
3331

34-
# Wait for all Prototype effects to be processed (the wait happens in the browser).
35-
#
36-
# Credits to http://github.com/brynary/webrat/tree/master
37-
def wait_for_effects(options={})
38-
builder = JavascriptExpressionBuilder.new active_javascript_framework(options)
39-
wait_for_condition builder.no_pending_effects.script,
40-
options[:timeout_in_seconds]
41-
end
32+
# Wait for all Prototype effects to be processed (the wait happens in the browser).
33+
#
34+
# Credits to http://github.com/brynary/webrat/tree/master
35+
def wait_for_effects(options={})
36+
builder = JavascriptExpressionBuilder.new active_javascript_framework(options)
37+
wait_for_condition builder.no_pending_effects.script, options[:timeout_in_seconds]
38+
end
4239

4340
# Wait for an element to be present (the wait happens in the browser).
4441
def wait_for_element(locator, options={})
@@ -54,8 +51,8 @@ def wait_for_no_element(locator, options={})
5451
wait_for_condition builder.script, options[:timeout_in_seconds]
5552
end
5653

57-
# Wait for some text to be present (the wait is happening browser side).
58-
#
54+
# Wait for some text to be present (the wait is happening browser side).
55+
#
5956
# wait_for_text will search for the given argument within the innerHTML
6057
# of the current DOM. Note that this method treats a single string
6158
# as a special case.
@@ -86,7 +83,7 @@ def wait_for_no_element(locator, options={})
8683
#
8784
def wait_for_text(pattern, options={})
8885
builder = JavascriptExpressionBuilder.new
89-
builder.find_text(pattern, options).append("text_match == true;")
86+
builder.find_text(pattern, options).append("text_match == true;")
9087
wait_for_condition builder.script, options[:timeout_in_seconds]
9188
end
9289

@@ -95,7 +92,7 @@ def wait_for_text(pattern, options={})
9592
# See wait_for_text for usage details.
9693
def wait_for_no_text(pattern, options={})
9794
builder = JavascriptExpressionBuilder.new
98-
builder.find_text(pattern, options).append("text_match == false;")
95+
builder.find_text(pattern, options).append("text_match == false;")
9996
wait_for_condition builder.script, options[:timeout_in_seconds]
10097
end
10198

@@ -132,4 +129,4 @@ def active_javascript_framework(options)
132129
end
133130

134131
end
135-
end
132+
end

rb/lib/selenium/client/idiomatic.rb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
module Selenium
2121
module Client
2222

23-
# Provide a more idiomatic API than the generated Ruby driver.
24-
#
25-
# Work in progress...
23+
# Provide a more idiomatic API than the generated Ruby driver.
24+
#
25+
# Work in progress...
2626
module Idiomatic
2727

2828
# Return the text content of an HTML element (rendered text shown to
@@ -102,31 +102,31 @@ def wait_for_popup(window_id, timeout_in_seconds=nil)
102102
def wait_for(options)
103103
if options[:wait_for] == :page
104104
wait_for_page options[:timeout_in_seconds]
105-
elsif options[:wait_for] == :ajax
106-
wait_for_ajax options
107-
elsif options[:wait_for] == :element
108-
wait_for_element options[:element], options
109-
elsif options[:wait_for] == :no_element
110-
wait_for_no_element options[:element], options
111-
elsif options[:wait_for] == :text
112-
wait_for_text options[:text], options
113-
elsif options[:wait_for] == :no_text
105+
elsif options[:wait_for] == :ajax
106+
wait_for_ajax options
107+
elsif options[:wait_for] == :element
108+
wait_for_element options[:element], options
109+
elsif options[:wait_for] == :no_element
110+
wait_for_no_element options[:element], options
111+
elsif options[:wait_for] == :text
112+
wait_for_text options[:text], options
113+
elsif options[:wait_for] == :no_text
114114
wait_for_no_text options[:text], options
115-
elsif options[:wait_for] == :effects
116-
wait_for_effects options
115+
elsif options[:wait_for] == :effects
116+
wait_for_effects options
117117
elsif options[:wait_for] == :popup
118-
wait_for_popup options[:window], options[:timeout_in_seconds]
119-
select_window options[:window] if options[:select]
118+
wait_for_popup options[:window], options[:timeout_in_seconds]
119+
select_window options[:window] if options[:select]
120120
elsif options[:wait_for] == :value
121-
wait_for_field_value options[:element], options[:value], options
121+
wait_for_field_value options[:element], options[:value], options
122122
elsif options[:wait_for] == :no_value
123-
wait_for_no_field_value options[:element], options[:value], options
123+
wait_for_no_field_value options[:element], options[:value], options
124124
elsif options[:wait_for] == :visible
125-
wait_for_visible options[:element], options
125+
wait_for_visible options[:element], options
126126
elsif options[:wait_for] == :not_visible
127-
wait_for_not_visible options[:element], options
128-
elsif options[:wait_for] == :condition
129-
wait_for_condition options[:javascript], options[:timeout_in_seconds]
127+
wait_for_not_visible options[:element], options
128+
elsif options[:wait_for] == :condition
129+
wait_for_condition options[:javascript], options[:timeout_in_seconds]
130130
end
131131
end
132132

@@ -206,7 +206,7 @@ def field(locator)
206206

207207
# Alias for +field+
208208
def value(locator)
209-
field locator
209+
field locator
210210
end
211211

212212
# Returns whether a toggle-button (checkbox/radio) is checked.
@@ -397,7 +397,7 @@ def cookie?(name)
397397
# the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.
398398
def create_cookie(name_value_pair, options="")
399399
if options.kind_of? Hash
400-
options = options.keys.collect {|key| "#{key}=#{options[key]}" }.sort.join(", ")
400+
options = options.keys.collect {|key| "#{key}=#{options[key]}" }.sort.join(", ")
401401
end
402402
remote_control_command "createCookie", [name_value_pair,options,]
403403
end
@@ -417,8 +417,8 @@ def create_cookie(name_value_pair, options="")
417417
# 'optionsString' is options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail.
418418
def delete_cookie(name, options="")
419419
if options.kind_of? Hash
420-
ordered_keys = options.keys.sort {|a,b| a.to_s <=> b.to_s }
421-
options = ordered_keys.collect {|key| "#{key}=#{options[key]}" }.join(", ")
420+
ordered_keys = options.keys.sort {|a,b| a.to_s <=> b.to_s }
421+
options = ordered_keys.collect {|key| "#{key}=#{options[key]}" }.join(", ")
422422
end
423423
remote_control_command "deleteCookie", [name,options,]
424424
end

rb/lib/selenium/client/javascript_expression_builder.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ def initialize(javascript_framework_name=nil)
2828
@script = ""
2929
end
3030

31-
def append(text)
32-
@script << text
33-
self
34-
end
31+
def append(text)
32+
@script << text
33+
self
34+
end
3535

3636
def no_pending_ajax_requests
3737
append window_script("#{@framework.ajax_request_tracker} == 0")
3838
end
3939

40-
def no_pending_effects
41-
append window_script("Effect.Queue.size() == 0")
42-
end
40+
def no_pending_effects
41+
append window_script("Effect.Queue.size() == 0")
42+
end
4343

4444
def visible(locator)
4545
append "selenium.isVisible('#{quote_escaped(locator)}')"
@@ -132,4 +132,4 @@ def quote_escaped(a_string)
132132
end
133133
end
134134
end
135-
end
135+
end

rb/spec/integration/selenium/client/api/backward_compatible_api_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121

2222
describe "Backward Compatible API" do
2323
it "provides legacy driver methods" do
24-
page.open "http://localhost:4444/selenium-server/org/openqa/selenium/tests/html/test_click_page1.html"
24+
page.open "http://localhost:4444/selenium-server/org/openqa/selenium/tests/html/test_click_page1.html"
2525

2626
expect(page.get_title).to eql("Click Page 1")
27-
expect(page.get_text("link").index("Click here for next page")).not_to be_nil
27+
expect(page.get_text("link").index("Click here for next page")).not_to be_nil
2828

29-
links = page.get_all_links
30-
expect(links.length).to be > 3
31-
expect(links[3]).to eql("linkToAnchorOnThisPage")
29+
links = page.get_all_links
30+
expect(links.length).to be > 3
31+
expect(links[3]).to eql("linkToAnchorOnThisPage")
3232

33-
page.click "link"
34-
page.wait_for_page_to_load 5000
35-
expect(page.get_location).to match(%r"/selenium-server/org/openqa/selenium/tests/html/test_click_page2.html")
33+
page.click "link"
34+
page.wait_for_page_to_load 5000
35+
expect(page.get_location).to match(%r"/selenium-server/org/openqa/selenium/tests/html/test_click_page2.html")
3636

37-
page.click "previousPage"
38-
page.wait_for_page_to_load 5000
39-
expect(page.get_location).to match(%r"/selenium-server/org/openqa/selenium/tests/html/test_click_page1.html")
37+
page.click "previousPage"
38+
page.wait_for_page_to_load 5000
39+
expect(page.get_location).to match(%r"/selenium-server/org/openqa/selenium/tests/html/test_click_page1.html")
4040
end
4141
end

0 commit comments

Comments
 (0)