yaks-html 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yaks-html/rspec.rb +16 -2
- data/lib/yaks/format/html.rb +5 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7dffb43894c21759c2fd140a7a20993538c4abb7
|
4
|
+
data.tar.gz: 2ced37b4d06fda844345f177119bc732b277b562
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fbdf6e3d03909389a80eb0915f1718de7066a0e736cae9ad7b02e3f769c85f9b37e6b494bd14aff745c864de008b35d55517fdbb024b96524d513915abe22f3
|
7
|
+
data.tar.gz: 715fac389b3e74f3e8f7f2cdbd0704ce2e40eb1d1c69c7cbe57e37f5ad3f914281d1bc39d0fcf175cc83d8269c1755b97e5a1cf12d9af4445c60d0376eece634
|
data/lib/yaks-html/rspec.rb
CHANGED
@@ -35,11 +35,11 @@ module YaksHTML
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def within_form(name, &block)
|
38
|
-
within(
|
38
|
+
within(find_form(name), &block)
|
39
39
|
end
|
40
40
|
|
41
41
|
def submit_form(name, &block)
|
42
|
-
within(
|
42
|
+
within(find_form(name)) do
|
43
43
|
yield block
|
44
44
|
submit!
|
45
45
|
end
|
@@ -52,6 +52,20 @@ module YaksHTML
|
|
52
52
|
def env
|
53
53
|
YaksHTML::RACK_ENV
|
54
54
|
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def find_form(name)
|
59
|
+
forms = all("form[@name=\"#{name}\"]")
|
60
|
+
|
61
|
+
if forms.empty?
|
62
|
+
fname = "/tmp/page-#{rand(999999999999999)}.html"
|
63
|
+
File.write(fname, page.body)
|
64
|
+
raise "No form found with name #{name}. Page saved as #{fname}"
|
65
|
+
end
|
66
|
+
|
67
|
+
forms.first
|
68
|
+
end
|
55
69
|
end
|
56
70
|
end
|
57
71
|
|
data/lib/yaks/format/html.rb
CHANGED
@@ -21,7 +21,11 @@ module Yaks
|
|
21
21
|
end.replace('.yaks-version') do |ver|
|
22
22
|
ver.content(Yaks::VERSION)
|
23
23
|
end.replace('.request-info') do |req|
|
24
|
-
|
24
|
+
if env['REQUEST_METHOD'] && env['PATH_INFO']
|
25
|
+
req.content(env['REQUEST_METHOD'], ' ', env['PATH_INFO'])
|
26
|
+
else
|
27
|
+
req
|
28
|
+
end
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaks-html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arne Brasseur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yaks
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.12.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.12.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hexp
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.5.1
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: HTML output format for Yaks
|