congress_forms 0.1.11 → 0.1.12

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: 24802b97596d0ab92b8dffd1798d2ab748a0acba
4
- data.tar.gz: 6adead4794c0552224ef28d87f338eae57aaa088
3
+ metadata.gz: 5dc781f1fa127f7d791fe00ced51a3bcb870d80f
4
+ data.tar.gz: ca38b5475b8bc7cee9e0fd527c19243d144d59ff
5
5
  SHA512:
6
- metadata.gz: eda4ccd32f0ac32ee54f391a378e9b90ba309c12fda18984b0348888556f3b9e2647d018d9ac062780e8040763e475182be2729abfc20e34a6f8a2002abd9c15
7
- data.tar.gz: 6ad0ea9129983007f93b5ae8b1d577b43ccc53292e0821d2da61bdb5659ce0978cb503f802c54eeaf70dfb68bb663a2876094f3d275bc6320ccd07bc84505600
6
+ metadata.gz: 7fbd7e0e8241aa3e655391bc32d897c53ecd13bbaf03dda872105657dd4e8bbfb21f91f83088670a7e830e496e561d53d6e2637fe9cf97be43a517e5c3f90c1a
7
+ data.tar.gz: 7d112a5df56ab5d71970fb543785a193f468dd44bdcab9fb4bc095e10da695e8afc95dcbe5836ae9e23e8882b736c6552c31843961ea6a8abd9877de2b3c6a98
@@ -1,4 +1,6 @@
1
1
  module CongressForms
2
+ UnsupportedAction = Class.new(Error)
3
+
2
4
  module Actions
3
5
  DEFAULT_FIND_WAIT_TIME = 5
4
6
 
@@ -6,7 +8,12 @@ module CongressForms
6
8
  key = step.keys.first
7
9
 
8
10
  const_name = key.capitalize.gsub(/_(\w)/){ |m| m[1].upcase }
9
- klass = const_get(const_name, false)
11
+
12
+ begin
13
+ klass = const_get(const_name, false)
14
+ rescue NameError => e
15
+ raise UnsupportedAction, "#{const_name} handler missing"
16
+ end
10
17
 
11
18
  if Visit == klass
12
19
  Array(klass.new("value" => step[key]))
@@ -88,7 +95,8 @@ module CongressForms
88
95
 
89
96
  browser.within(selector) do
90
97
  if placeholder_value?
91
- option_value = user_value
98
+ option_value = user_value or
99
+ raise Error, "Required field missing: #{value}"
92
100
  else
93
101
  option_value = value
94
102
  end
@@ -1,3 +1,3 @@
1
1
  module CongressForms
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: congress_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Woo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-29 00:00:00.000000000 Z
11
+ date: 2019-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry