watir 6.2.1 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfb993f1f8e46cb5a58c37e008c476050814ac65
4
- data.tar.gz: db6967abba308be2cdd3fcd140e6063222a7db07
3
+ metadata.gz: 6d3a0cb0525118548da109542afb75980a1d42cf
4
+ data.tar.gz: 0bc02ea05b55da8b92650cecfd3a3a3fe98ab39b
5
5
  SHA512:
6
- metadata.gz: baa72d6022e1af45db9183ce4582913264ecfa6b9519db23f7bebc418404312b1581d695064b119abc6ec9d58791bb607072e0591a8fe883d9afd79754286d94
7
- data.tar.gz: 8676c1791eac366796f1c471171b97cb7b6bc62607bc34cfb4daa08e6b4ccd2aa0cbeaf959b297ca10ba7983844cbacf44c38a00f142165a303c6c22e0c58362
6
+ metadata.gz: 03f724ca3a53ec63b963d76bc6f36f727003d52b484032ac3790f1962ad2b5a8f5e90e9864a18cd644fd51451030715a13d0d3805077749e79fce4f00d48b6cc
7
+ data.tar.gz: 66cf35ca15c505bc84dec52bc9b42303c7ba6c3473703a8edc91ea80882f1e48d6ff8d17de888ee5dcab3633dd0e7573de46d81bdafd7bba923fa851fc44a045
data/.travis.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  dist: trusty
2
2
  sudo: require
3
3
  rvm:
4
- - 2.2.6
5
- - 2.3.3
6
- - 2.4.0
4
+ - 2.2.7
5
+ - 2.3.4
6
+ - 2.4.1
7
7
  addons:
8
8
  firefox: latest
9
9
  apt:
@@ -20,8 +20,6 @@ notifications:
20
20
  slack:
21
21
  secure: BLsBCm33R32VNRccrLx9F0P24X6BVpVHj1OWaN4Kyn6g9qXteIwC2VKVMnKNbifpojfMkrn0OeFQFK1O1DSOsC3mgzn/udoB+DnUGcSemFUn04xhbYF5SI+3zGPKPo0JLvjjdEKSSma84YwKdrj88pGUK34p01gL8hiaqjFzWdk=
22
22
  before_script:
23
- - mkdir travis-drivers
24
- - export PATH=$PWD/travis-drivers:$PATH
25
23
  - support/travis.sh
26
24
  script: bundle exec rake $RAKE_TASK
27
25
  env:
@@ -29,6 +27,4 @@ env:
29
27
  - RAKE_TASK=spec:firefox RELAXED_LOCATE=false
30
28
  - RAKE_TASK=spec:chrome
31
29
  - RAKE_TASK=spec:chrome RELAXED_LOCATE=false
32
- - RAKE_TASK=spec:phantomjs
33
- - RAKE_TASK=spec:phantomjs RELAXED_LOCATE=false
34
30
  - RAKE_TASK=yard:doctest
data/CHANGES.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 6.3.0 (2017-06-20)
2
+
3
+ * Allow locating elements by attribute presence/absence (#345)
4
+ * Element#flash configurable by color, number, and delay (thanks Paul3816547290)
5
+ * Implement Select#text like Select#value (thanks Arik Jones)
6
+ * Optimize Select#selected_options, Select#value, and Select#text with javascript (thanks Andrei Botalov)
7
+ * Support locating elements by #execute_script from inside frame context
8
+
1
9
  ### 6.2.1 (2017-03-22)
2
10
 
3
11
  * Allow sending text to FileField without checking element is #visible?
data/Rakefile CHANGED
@@ -126,7 +126,6 @@ namespace :spec do
126
126
  task browsers: [:chrome,
127
127
  :firefox,
128
128
  :ff_legacy,
129
- :phantomjs,
130
129
  (:safari if Selenium::WebDriver::Platform.mac?),
131
130
  (:ie if Selenium::WebDriver::Platform.windows?),
132
131
  (:edge if Selenium::WebDriver::Platform.windows?)].compact
@@ -135,12 +134,11 @@ namespace :spec do
135
134
  task remote_browsers: [:remote_chrome,
136
135
  :remote_firefox,
137
136
  :remote_ff_legacy,
138
- :remote_phantomjs,
139
137
  (:remote_safari if Selenium::WebDriver::Platform.mac?),
140
138
  (:remote_ie if Selenium::WebDriver::Platform.windows?),
141
139
  (:remote_edge if Selenium::WebDriver::Platform.windows?)].compact
142
140
 
143
- %w(firefox ff_legacy chrome safari phantomjs ie edge).each do |browser|
141
+ %w(firefox ff_legacy chrome safari ie edge).each do |browser|
144
142
  desc "Run specs in #{browser}"
145
143
  task browser do
146
144
  ENV['WATIR_BROWSER'] = browser
data/lib/watir/browser.rb CHANGED
@@ -258,7 +258,7 @@ module Watir
258
258
  args.map! { |e| e.kind_of?(Watir::Element) ? e.wd : e }
259
259
  returned = @driver.execute_script(script, *args)
260
260
 
261
- wrap_elements_in(returned)
261
+ wrap_elements_in(self, returned)
262
262
  end
263
263
 
264
264
  #
@@ -324,14 +324,14 @@ module Watir
324
324
 
325
325
  private
326
326
 
327
- def wrap_elements_in(obj)
327
+ def wrap_elements_in(scope, obj)
328
328
  case obj
329
329
  when Selenium::WebDriver::Element
330
- wrap_element(obj)
330
+ wrap_element(scope, obj)
331
331
  when Array
332
- obj.map { |e| wrap_elements_in(e) }
332
+ obj.map { |e| wrap_elements_in(scope, e) }
333
333
  when Hash
334
- obj.each { |k,v| obj[k] = wrap_elements_in(v) }
334
+ obj.each { |k,v| obj[k] = wrap_elements_in(scope, v) }
335
335
 
336
336
  obj
337
337
  else
@@ -339,8 +339,8 @@ module Watir
339
339
  end
340
340
  end
341
341
 
342
- def wrap_element(element)
343
- Watir.element_class_for(element.tag_name.downcase).new(self, element: element)
342
+ def wrap_element(scope, element)
343
+ Watir.element_class_for(element.tag_name.downcase).new(scope, element: element)
344
344
  end
345
345
 
346
346
  end # Browser
@@ -213,19 +213,28 @@ module Watir
213
213
  end
214
214
 
215
215
  #
216
- # Flashes (change background color far a moment) element.
216
+ # Flashes (change background color to a new color and back a few times) element.
217
217
  #
218
218
  # @example
219
219
  # browser.text_field(name: "new_user_first_name").flash
220
+ # browser.text_field(name: "new_user_first_name").flash(color: "green", flashes: 3, delay: 0.05)
221
+ # browser.text_field(name: "new_user_first_name").flash(color: "yellow")
222
+ # browser.text_field(name: "new_user_first_name").flash(flashes: 4)
223
+ # browser.text_field(name: "new_user_first_name").flash(delay: 0.1)
224
+ #
225
+ # @param [String] color what color to flash with
226
+ # @param [Integer] flashes number of times element should be flashed
227
+ # @param [Integer, Float] delay how long to wait between flashes
220
228
  #
221
229
 
222
- def flash
230
+ def flash(color: 'red', flashes: 10, delay: 0)
223
231
  background_color = style("backgroundColor")
224
232
  element_color = driver.execute_script("arguments[0].style.backgroundColor", @element)
225
233
 
226
- 10.times do |n|
227
- color = (n % 2 == 0) ? "red" : background_color
228
- driver.execute_script("arguments[0].style.backgroundColor = '#{color}'", @element)
234
+ flashes.times do |n|
235
+ nextcolor = n.even? ? color : background_color
236
+ driver.execute_script("arguments[0].style.backgroundColor = '#{nextcolor}'", @element)
237
+ sleep(delay)
229
238
  end
230
239
 
231
240
  driver.execute_script("arguments[0].style.backgroundColor = arguments[1]", @element, element_color)
@@ -458,6 +467,13 @@ module Watir
458
467
  @query_scope.browser
459
468
  end
460
469
 
470
+ #
471
+ # Delegates script execution to Browser or IFrame.
472
+ #
473
+ def execute_script(script, *args)
474
+ @query_scope.execute_script(script, *args)
475
+ end
476
+
461
477
  #
462
478
  # Returns true if a previously located element is no longer attached to DOM.
463
479
  #
@@ -54,8 +54,17 @@ module Watir
54
54
  wd.page_source
55
55
  end
56
56
 
57
- def execute_script(*args)
58
- browser.execute_script(*args)
57
+ #
58
+ # Executes JavaScript snippet in context of frame.
59
+ #
60
+ # @see Watir::Browser#execute_script
61
+ #
62
+
63
+ def execute_script(script, *args)
64
+ args.map! { |e| e.kind_of?(Watir::Element) ? e.wd : e }
65
+ returned = driver.execute_script(script, *args)
66
+
67
+ browser.send :wrap_elements_in, self, returned
59
68
  end
60
69
 
61
70
  private
@@ -23,8 +23,9 @@ module Watir
23
23
  #
24
24
 
25
25
  def width
26
- wait_for_exists
27
- driver.execute_script "return arguments[0].width", @element
26
+ element_call do
27
+ driver.execute_script "return arguments[0].width", @element
28
+ end
28
29
  end
29
30
 
30
31
  end # Image
@@ -100,19 +100,40 @@ module Watir
100
100
  #
101
101
 
102
102
  def value
103
- o = options.find { |e| e.selected? } || return
104
- o.value
103
+ option = selected_options.first
104
+ option && option.value
105
105
  end
106
106
 
107
-
108
107
  #
108
+ # Returns the text of the first selected option in the select list.
109
+ # Returns nil if no option is selected.
110
+ #
111
+ # @return [String, nil]
112
+ #
113
+
114
+ def text
115
+ option = selected_options.first
116
+ option && option.text
117
+ end
118
+
109
119
  # Returns an array of currently selected options.
110
120
  #
111
121
  # @return [Array<Watir::Option>]
112
122
  #
113
123
 
114
124
  def selected_options
115
- options.select { |e| e.selected? }
125
+ element_call do
126
+ script = <<-SCRIPT
127
+ var result = [];
128
+ var options = arguments[0].options;
129
+ for (var i = 0; i < options.length; i++) {
130
+ var option = options[i];
131
+ if (option.selected) { result.push(option) }
132
+ }
133
+ return result;
134
+ SCRIPT
135
+ @query_scope.execute_script(script, self)
136
+ end
116
137
  end
117
138
 
118
139
  private
@@ -3,8 +3,9 @@ Watir::Atoms.load :selectText
3
3
  module Watir
4
4
  class Element
5
5
  def select_text(str)
6
- wait_for_exists
7
- execute_atom :selectText, @element, str
6
+ element_call do
7
+ execute_atom :selectText, @element, str
8
+ end
8
9
  end
9
10
  end # Element
10
11
  end # Watir
@@ -2,7 +2,7 @@ module Watir
2
2
  module Locators
3
3
  class Element
4
4
  class SelectorBuilder
5
- VALID_WHATS = [String, Regexp]
5
+ VALID_WHATS = [String, Regexp, TrueClass, FalseClass].freeze
6
6
  WILDCARD_ATTRIBUTE = /^(aria|data)_(.+)$/
7
7
 
8
8
  def initialize(query_scope, selector, valid_attributes)
@@ -28,6 +28,10 @@ module Watir
28
28
  f = selectors.map do |key, val|
29
29
  if val.is_a?(Array)
30
30
  "(" + val.map { |v| equal_pair(building, key, v) }.join(" or ") + ")"
31
+ elsif val == true
32
+ attribute_presence(key)
33
+ elsif val == false
34
+ attribute_absence(key)
31
35
  else
32
36
  equal_pair(building, key, val)
33
37
  end
@@ -65,6 +69,16 @@ module Watir
65
69
  "@#{key.to_s.tr("_", "-")}"
66
70
  end
67
71
  end
72
+
73
+ private
74
+
75
+ def attribute_presence(attribute)
76
+ lhs_for(nil, attribute)
77
+ end
78
+
79
+ def attribute_absence(attribute)
80
+ "not(#{lhs_for(nil, attribute)})"
81
+ end
68
82
  end
69
83
  end
70
84
  end
@@ -83,9 +83,9 @@ WatirSpec.implementation do |watirspec|
83
83
  #
84
84
  # watirspec.name = :watizzle
85
85
  # watirspec.browser_class = Watir::Browser
86
- # watirspec.browser_args = [:phantomjs, {}]
86
+ # watirspec.browser_args = [:firefox, {}]
87
87
  # watirspec.guard_proc = lambda do |args|
88
- # args.include?(:phantomjs)
88
+ # args.include?(:firefox)
89
89
  # end
90
90
  end
91
91
 
@@ -47,6 +47,18 @@ describe Watir::Locators::Element::Locator do
47
47
  locate_one [:dir, "foo",
48
48
  :title, "bar"]
49
49
  end
50
+
51
+ it "handles selector with attribute presence" do
52
+ expect_one :xpath, ".//*[@data-view]"
53
+
54
+ locate_one [:data_view, true]
55
+ end
56
+
57
+ it "handles selector with attribute absence" do
58
+ expect_one :xpath, ".//*[not(@data-view)]"
59
+
60
+ locate_one [:data_view, false]
61
+ end
50
62
  end
51
63
 
52
64
  describe "with special cased selectors" do
@@ -288,10 +300,10 @@ describe Watir::Locators::Element::Locator do
288
300
  raise_error(TypeError, %[expected Integer, got "bar":String])
289
301
  end
290
302
 
291
- it "raises a TypeError if selector value is not a String or Regexp" do
303
+ it "raises a TypeError if selector value is not a String, Regexp or Boolean" do
292
304
  num_type = RUBY_VERSION[/^\d+\.(\d+)/, 1].to_i >= 4 ? 'Integer' : 'Fixnum'
293
305
  expect { locate_one(tag_name: 123) }.to \
294
- raise_error(TypeError, %[expected one of [String, Regexp], got 123:#{num_type}])
306
+ raise_error(TypeError, %[expected one of [String, Regexp, TrueClass, FalseClass], got 123:#{num_type}])
295
307
  end
296
308
 
297
309
  it "raises a MissingWayOfFindingObjectException if the attribute is not valid" do
@@ -104,61 +104,59 @@ describe "Browser::AfterHooks" do
104
104
  end
105
105
  end
106
106
 
107
- bug "https://github.com/detro/ghostdriver/issues/20", :phantomjs do
108
- not_compliant_on :safari do
109
- it "runs after_hooks after Alert#ok" do
107
+ not_compliant_on :safari do
108
+ it "runs after_hooks after Alert#ok" do
109
+ browser.goto(WatirSpec.url_for("alerts.html"))
110
+ @page_after_hook = Proc.new { @yield = browser.title == "Alerts" }
111
+ browser.after_hooks.add @page_after_hook
112
+ browser.after_hooks.without { browser.button(id: 'alert').click }
113
+ browser.alert.ok
114
+ expect(@yield).to be true
115
+ end
116
+
117
+ bug "https://code.google.com/p/chromedriver/issues/detail?id=26", [:chrome, :macosx] do
118
+ it "runs after_hooks after Alert#close" do
110
119
  browser.goto(WatirSpec.url_for("alerts.html"))
111
120
  @page_after_hook = Proc.new { @yield = browser.title == "Alerts" }
112
121
  browser.after_hooks.add @page_after_hook
113
122
  browser.after_hooks.without { browser.button(id: 'alert').click }
114
- browser.alert.ok
123
+ browser.alert.close
115
124
  expect(@yield).to be true
116
125
  end
126
+ end
117
127
 
118
- bug "https://code.google.com/p/chromedriver/issues/detail?id=26", [:chrome, :macosx] do
119
- it "runs after_hooks after Alert#close" do
120
- browser.goto(WatirSpec.url_for("alerts.html"))
121
- @page_after_hook = Proc.new { @yield = browser.title == "Alerts" }
122
- browser.after_hooks.add @page_after_hook
123
- browser.after_hooks.without { browser.button(id: 'alert').click }
124
- browser.alert.close
125
- expect(@yield).to be true
126
- end
127
- end
128
-
129
- bug "https://bugzilla.mozilla.org/show_bug.cgi?id=1279211", :firefox do
130
- it "raises UnhandledAlertError error when running error checks with alert present" do
131
- url = WatirSpec.url_for("alerts.html")
132
- @page_after_hook = Proc.new { browser.url }
133
- browser.after_hooks.add @page_after_hook
134
- browser.goto url
135
- expect { browser.button(id: "alert").click }.to raise_error(Selenium::WebDriver::Error::UnhandledAlertError)
136
-
137
- not_compliant_on :ff_legacy do
138
- browser.alert.ok
139
- end
140
- end
141
- end
142
-
143
- it "does not raise error when running error checks using #after_hooks#without with alert present" do
128
+ bug "https://bugzilla.mozilla.org/show_bug.cgi?id=1279211", :firefox do
129
+ it "raises UnhandledAlertError error when running error checks with alert present" do
144
130
  url = WatirSpec.url_for("alerts.html")
145
131
  @page_after_hook = Proc.new { browser.url }
146
132
  browser.after_hooks.add @page_after_hook
147
133
  browser.goto url
148
- expect { browser.after_hooks.without {browser.button(id: "alert").click} }.to_not raise_error
149
- browser.alert.ok
150
- end
134
+ expect { browser.button(id: "alert").click }.to raise_error(Selenium::WebDriver::Error::UnhandledAlertError)
151
135
 
152
- it "does not raise error if no error checks are defined with alert present" do
153
- url = WatirSpec.url_for("alerts.html")
154
- @page_after_hook = Proc.new { browser.url }
155
- browser.after_hooks.add @page_after_hook
156
- browser.goto url
157
- browser.after_hooks.delete @page_after_hook
158
- expect { browser.button(id: "alert").click }.to_not raise_error
159
- browser.alert.ok
136
+ not_compliant_on :ff_legacy do
137
+ browser.alert.ok
138
+ end
160
139
  end
161
140
  end
141
+
142
+ it "does not raise error when running error checks using #after_hooks#without with alert present" do
143
+ url = WatirSpec.url_for("alerts.html")
144
+ @page_after_hook = Proc.new { browser.url }
145
+ browser.after_hooks.add @page_after_hook
146
+ browser.goto url
147
+ expect { browser.after_hooks.without { browser.button(id: "alert").click } }.to_not raise_error
148
+ browser.alert.ok
149
+ end
150
+
151
+ it "does not raise error if no error checks are defined with alert present" do
152
+ url = WatirSpec.url_for("alerts.html")
153
+ @page_after_hook = Proc.new { browser.url }
154
+ browser.after_hooks.add @page_after_hook
155
+ browser.goto url
156
+ browser.after_hooks.delete @page_after_hook
157
+ expect { browser.button(id: "alert").click }.to_not raise_error
158
+ browser.alert.ok
159
+ end
162
160
  end
163
161
 
164
162
  bug "https://bugzilla.mozilla.org/show_bug.cgi?id=1223277", :firefox do
@@ -1,98 +1,96 @@
1
1
  require "watirspec_helper"
2
2
 
3
3
  describe 'Alert API' do
4
- bug "https://github.com/detro/ghostdriver/issues/20", :phantomjs do
5
- not_compliant_on :safari do
6
- before do
7
- browser.goto WatirSpec.url_for("alerts.html")
8
- end
4
+ not_compliant_on :safari do
5
+ before do
6
+ browser.goto WatirSpec.url_for("alerts.html")
7
+ end
8
+
9
+ after do
10
+ browser.alert.ok if browser.alert.exists?
11
+ end
9
12
 
10
- after do
11
- browser.alert.ok if browser.alert.exists?
13
+ context 'alert' do
14
+ describe '#text' do
15
+ it 'returns text of alert' do
16
+ browser.button(id: 'alert').click
17
+ expect(browser.alert.text).to include('ok')
18
+ end
12
19
  end
13
20
 
14
- context 'alert' do
15
- describe '#text' do
16
- it 'returns text of alert' do
17
- browser.button(id: 'alert').click
18
- expect(browser.alert.text).to include('ok')
19
- end
21
+ describe '#exists?' do
22
+ it 'returns false if alert is not present' do
23
+ expect(browser.alert).to_not exist
20
24
  end
21
25
 
22
- describe '#exists?' do
23
- it 'returns false if alert is not present' do
24
- expect(browser.alert).to_not exist
25
- end
26
+ it 'returns true if alert is present' do
27
+ browser.button(id: 'alert').click
28
+ browser.wait_until(timeout: 10) { browser.alert.exists? }
29
+ end
30
+ end
26
31
 
27
- it 'returns true if alert is present' do
28
- browser.button(id: 'alert').click
29
- browser.wait_until(timeout: 10) { browser.alert.exists? }
30
- end
32
+ describe '#ok' do
33
+ it 'closes alert' do
34
+ browser.button(id: 'alert').click
35
+ browser.alert.ok
36
+ expect(browser.alert).to_not exist
31
37
  end
38
+ end
32
39
 
33
- describe '#ok' do
40
+ bug "https://code.google.com/p/chromedriver/issues/detail?id=26", [:chrome, :macosx] do
41
+ describe '#close' do
34
42
  it 'closes alert' do
35
43
  browser.button(id: 'alert').click
36
- browser.alert.ok
44
+ browser.alert.close
37
45
  expect(browser.alert).to_not exist
38
46
  end
39
47
  end
48
+ end
40
49
 
41
- bug "https://code.google.com/p/chromedriver/issues/detail?id=26", [:chrome, :macosx] do
42
- describe '#close' do
43
- it 'closes alert' do
44
- browser.button(id: 'alert').click
45
- browser.alert.close
46
- expect(browser.alert).to_not exist
47
- end
50
+ not_compliant_on :relaxed_locate do
51
+ describe 'wait_until_present' do
52
+ it 'waits until alert is present and goes on' do
53
+ browser.button(id: 'timeout-alert').click
54
+ browser.alert.wait_until_present.ok
55
+
56
+ expect(browser.alert).to_not exist
48
57
  end
49
- end
50
58
 
51
- not_compliant_on :relaxed_locate do
52
- describe 'wait_until_present' do
53
- it 'waits until alert is present and goes on' do
54
- browser.button(id: 'timeout-alert').click
59
+ it 'raises error if alert is not present after timeout' do
60
+ expect {
55
61
  browser.alert.wait_until_present.ok
56
-
57
- expect(browser.alert).to_not exist
58
- end
59
-
60
- it 'raises error if alert is not present after timeout' do
61
- expect {
62
- browser.alert.wait_until_present.ok
63
- }.to raise_error(Watir::Wait::TimeoutError)
64
- end
62
+ }.to raise_error(Watir::Wait::TimeoutError)
65
63
  end
66
64
  end
67
65
  end
66
+ end
68
67
 
69
- context 'confirm' do
70
- describe '#ok' do
71
- it 'accepts confirm' do
72
- browser.button(id: 'confirm').click
73
- browser.alert.ok
74
- expect(browser.button(id: 'confirm').value).to eq "true"
75
- end
68
+ context 'confirm' do
69
+ describe '#ok' do
70
+ it 'accepts confirm' do
71
+ browser.button(id: 'confirm').click
72
+ browser.alert.ok
73
+ expect(browser.button(id: 'confirm').value).to eq "true"
76
74
  end
75
+ end
77
76
 
78
- describe '#close' do
79
- it 'cancels confirm' do
80
- browser.button(id: 'confirm').click
81
- browser.alert.close
82
- expect(browser.button(id: 'confirm').value).to eq "false"
83
- end
77
+ describe '#close' do
78
+ it 'cancels confirm' do
79
+ browser.button(id: 'confirm').click
80
+ browser.alert.close
81
+ expect(browser.button(id: 'confirm').value).to eq "false"
84
82
  end
85
83
  end
84
+ end
86
85
 
87
- context 'prompt' do
88
- describe '#set' do
89
- bug "https://bugzilla.mozilla.org/show_bug.cgi?id=1255906", :firefox do
90
- it 'enters text to prompt' do
91
- browser.button(id: 'prompt').click
92
- browser.alert.set 'My Name'
93
- browser.alert.ok
94
- expect(browser.button(id: 'prompt').value).to eq 'My Name'
95
- end
86
+ context 'prompt' do
87
+ describe '#set' do
88
+ bug "https://bugzilla.mozilla.org/show_bug.cgi?id=1255906", :firefox do
89
+ it 'enters text to prompt' do
90
+ browser.button(id: 'prompt').click
91
+ browser.alert.set 'My Name'
92
+ browser.alert.ok
93
+ expect(browser.button(id: 'prompt').value).to eq 'My Name'
96
94
  end
97
95
  end
98
96
  end