superbara 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27a8bbaf155457a0bb1dcb511c4e4081b6c8631d4caf71c29dc4a4cb37a7ee60
4
- data.tar.gz: 93338098098c6d467b293367234c1f8690c5ecb1517004c83460edfff9c93faa
3
+ metadata.gz: 8f4295350bebd45aadb239fbcc40fc37ff90d5ff68a3034fedfc00aafedc5126
4
+ data.tar.gz: 74cb152022563849a2dce5d9944ecd3b5b81c8631133d1091522e5391d6a8132
5
5
  SHA512:
6
- metadata.gz: e5ae25605b3be93f76251dae87287e1c7010f22959a5b944f0bbb8c505e70c3e2f9b03b946452fa6d7b96bda296841f3813343ff73e734c9b9ed8e687a18db56
7
- data.tar.gz: d8a4b309d2087703461700df621dc197464405aa2530f98e111c0581f6f2d302b5200c82de17454403004aeb13ded29f70df8e44c55d7f24464b9b3b6dc860c1
6
+ metadata.gz: a44befc00835d55eddedc686dda81c74b7c4a4e52a16446a124e33c4e9702c8fa2c041219b18f799876bcafcbdb256cb0a4b2f4a93629b98d4a351e07bebbb64
7
+ data.tar.gz: 42c74aa672ef8c84db20aedd5df80e15aaf2b1d94b79f326dc7252cc8ca276611c44323ca92704526b4da8d8855a484d48bd98183aac56f3803e7949bb09855c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superbara (0.10.0)
4
+ superbara (0.11.0)
5
5
  binding_of_caller (~> 0.8, >= 0.8.0)
6
6
  capybara (~> 3.1, >= 3.1.0)
7
7
  colorize (~> 0.8, >= 0.8.1)
@@ -1,6 +1,6 @@
1
1
  visit 'vr.fi'
2
2
 
3
- languages = wait 3 do
3
+ languages = wait do
4
4
  find("div.langbox")
5
5
  end
6
6
 
@@ -16,6 +16,6 @@ type "tamp", :down, :enter
16
16
 
17
17
  type :enter
18
18
 
19
- wait 5 do
19
+ wait 10 do
20
20
  has_text? "Outbound journey: Helsinki → Tampere"
21
21
  end
@@ -21,6 +21,14 @@ sleep 0.0001
21
21
  end
22
22
  end
23
23
 
24
+ params.each_pair do |k,v|
25
+ eval = "@#{k} = "
26
+ eval << "'" if v.class == String
27
+ eval << v
28
+ eval << "'" if v.class == String
29
+ Superbara.main.instance_eval "@#{k} = #{eval}"
30
+ end
31
+
24
32
  begin
25
33
  load path, true
26
34
  rescue Superbara::Errors::NotDesiredTagError
@@ -28,7 +36,7 @@ sleep 0.0001
28
36
  end
29
37
 
30
38
  params.each_pair do |k,v|
31
- Superbara.main.instance_eval "undef #{k.to_sym}"
39
+ Superbara.main.instance_eval "remove_instance_variable '@#{k}'"
32
40
  end
33
41
  end
34
42
 
data/lib/superbara/dsl.rb CHANGED
@@ -117,6 +117,7 @@ return Array.from(
117
117
  Superbara.project_path = File.dirname(better_what)
118
118
  end
119
119
 
120
+ error_happened = false
120
121
  begin
121
122
  Superbara.current_context.__superbara_load(better_what, params)
122
123
  rescue Exception => ex
@@ -126,11 +127,19 @@ return Array.from(
126
127
  #TODO: output to support "colored tags" and nesting
127
128
  Superbara.output colored_output
128
129
  Superbara.errored_runs << what
130
+ error_happened = true
129
131
  else
130
132
  raise ex
131
133
  end
132
134
  end
135
+
133
136
  Superbara.project_path = old_project_path
137
+
138
+ if error_happened
139
+ false
140
+ else
141
+ true
142
+ end
134
143
  end
135
144
 
136
145
  def visit(visit_uri_or_domain_or_path)
@@ -1,3 +1,3 @@
1
1
  module Superbara
2
- VERSION = "0.10.0"
2
+ VERSION = "0.11.0"
3
3
  end
@@ -1,3 +1,15 @@
1
- run "first_failing"
2
- run "second_ok"
3
- run "third_failing"
1
+ first = run "first_failing"
2
+ second = run "second_ok"
3
+ third = run "third_failing"
4
+
5
+ assert do
6
+ first == false
7
+ end
8
+
9
+ assert do
10
+ second == true
11
+ end
12
+
13
+ assert do
14
+ third == false
15
+ end
@@ -0,0 +1,7 @@
1
+ assert do
2
+ @first == "hello"
3
+ end
4
+
5
+ assert do
6
+ @second == "world"
7
+ end
@@ -0,0 +1,7 @@
1
+ assert do
2
+ @first.nil?
3
+ end
4
+
5
+ assert do
6
+ @second.nil?
7
+ end
data/tests/run/main.rb CHANGED
@@ -1,2 +1,2 @@
1
- run "has_locals", first: "hello", second: "world"
2
- run "has_no_locals"
1
+ run "has_instance_variables", first: "hello", second: "world"
2
+ run "has_no_instance_variables"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superbara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matti Paksula
@@ -354,8 +354,8 @@ files:
354
354
  - tests/features/type.rb
355
355
  - tests/features/wait.rb
356
356
  - tests/minimal/main.rb
357
- - tests/run/has_locals.rb
358
- - tests/run/has_no_locals.rb
357
+ - tests/run/has_instance_variables.rb
358
+ - tests/run/has_no_instance_variables.rb
359
359
  - tests/run/main.rb
360
360
  - vendor/chromedriver/linux64/.gitkeep
361
361
  - vendor/chromedriver/linux64/chromedriver
@@ -1,7 +0,0 @@
1
- assert do
2
- first == "hello"
3
- end
4
-
5
- assert do
6
- second == "world"
7
- end
@@ -1,7 +0,0 @@
1
- assert do
2
- ! respond_to? :first
3
- end
4
-
5
- assert do
6
- ! respond_to? :second
7
- end