page_navigation 0.7 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/ChangeLog +3 -0
- data/lib/page_navigation.rb +20 -1
- data/lib/page_navigation/version.rb +1 -1
- data/spec/lib/page_navigation_spec.rb +21 -0
- metadata +13 -24
- data/.rvmrc +0 -2
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b9fed5b23e25332d84fcbfea7eb49b03fb55e7a5
|
4
|
+
data.tar.gz: 045317e8335c63ba4215b327bfe5b3bd24c3d105
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bb65f1c891e370783cb56234a0118088e1d737696f6ebc604e12b51cfa6eb5ea9a151189f84a349f72eb23581df9f4f3f1b3146e51416f897b7ec5d0cc0795a8
|
7
|
+
data.tar.gz: 10b4624ea7f9ddc9c94561228b7e2c7fd42888e7246de65944a602dd52cf9f61ba62dffc30b0979994e52637f42e4ee9ddc18d4e79b5c94c344f50fcb85c6e9a
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
page-object
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.0.0-p0
|
data/ChangeLog
CHANGED
data/lib/page_navigation.rb
CHANGED
@@ -16,7 +16,7 @@ require 'data_magic'
|
|
16
16
|
# :another_route => [[PageOne,:method1, "arg1"], [PageTwoB,:method2b], [PageThree,:method3]]
|
17
17
|
# }
|
18
18
|
#
|
19
|
-
# Notice the first entry of :
|
19
|
+
# Notice the first entry of :another_route is passing an argument
|
20
20
|
# to the method.
|
21
21
|
#
|
22
22
|
# The user must also maintain an instance variable named @current_page
|
@@ -88,6 +88,25 @@ module PageNavigation
|
|
88
88
|
on(page_cls, &block)
|
89
89
|
end
|
90
90
|
|
91
|
+
#
|
92
|
+
# Navigate through a complete route.
|
93
|
+
#
|
94
|
+
# This method will navigate an entire route executing all of the
|
95
|
+
# methods. Since it completes the route it does not return any
|
96
|
+
# pages and it does not accept a block.
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
# page.navigate_all # will use the default path
|
100
|
+
# page.navigate_all(:using => :another_route)
|
101
|
+
#
|
102
|
+
# @param [Hash] a hash that contains an element with the key
|
103
|
+
# :using. This will be used to lookup the route. It has a
|
104
|
+
# default value of :default.
|
105
|
+
#
|
106
|
+
def navigate_all(how = {:using => :default})
|
107
|
+
path = path_for how
|
108
|
+
navigate_through_pages(path[0..-1])
|
109
|
+
end
|
91
110
|
|
92
111
|
private
|
93
112
|
|
@@ -124,4 +124,25 @@ describe PageNavigation do
|
|
124
124
|
a_page.should_receive(:b_method)
|
125
125
|
@navigator.continue_navigation_to(YetAnotherPage).class.should == YetAnotherPage
|
126
126
|
end
|
127
|
+
|
128
|
+
it "should know how to navigate an entire route including the last page" do
|
129
|
+
TestNavigator.routes = {
|
130
|
+
:default => [[FactoryTestPage, :a_method],
|
131
|
+
[AnotherPage, :b_method],
|
132
|
+
[YetAnotherPage, :c_method]]
|
133
|
+
}
|
134
|
+
f_page = FactoryTestPage.new
|
135
|
+
a_page = AnotherPage.new
|
136
|
+
y_page = YetAnotherPage.new
|
137
|
+
FactoryTestPage.should_receive(:new).and_return(f_page)
|
138
|
+
f_page.should_receive(:respond_to?).with(:a_method).and_return(true)
|
139
|
+
f_page.should_receive(:a_method)
|
140
|
+
AnotherPage.should_receive(:new).and_return(a_page)
|
141
|
+
a_page.should_receive(:respond_to?).with(:b_method).and_return(true)
|
142
|
+
a_page.should_receive(:b_method)
|
143
|
+
YetAnotherPage.should_receive(:new).and_return(y_page)
|
144
|
+
y_page.should_receive(:respond_to?).with(:c_method).and_return(true)
|
145
|
+
y_page.should_receive(:c_method)
|
146
|
+
@navigator.navigate_all
|
147
|
+
end
|
127
148
|
end
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page_navigation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
5
|
-
prerelease:
|
4
|
+
version: '0.8'
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jeffrey S. Morgan
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-04-27 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: data_magic
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0.14'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0.14'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 2.12.0
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 2.12.0
|
46
41
|
description: Provides basic navigation through a collection of items that use the
|
@@ -53,7 +48,8 @@ extra_rdoc_files: []
|
|
53
48
|
files:
|
54
49
|
- .gitignore
|
55
50
|
- .rspec
|
56
|
-
- .
|
51
|
+
- .ruby-gemset
|
52
|
+
- .ruby-version
|
57
53
|
- ChangeLog
|
58
54
|
- Gemfile
|
59
55
|
- Guardfile
|
@@ -68,33 +64,26 @@ files:
|
|
68
64
|
- spec/spec_helper.rb
|
69
65
|
homepage: http://github.com/cheezy/page_navigation
|
70
66
|
licenses: []
|
67
|
+
metadata: {}
|
71
68
|
post_install_message:
|
72
69
|
rdoc_options: []
|
73
70
|
require_paths:
|
74
71
|
- lib
|
75
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
73
|
requirements:
|
78
|
-
- -
|
74
|
+
- - '>='
|
79
75
|
- !ruby/object:Gem::Version
|
80
76
|
version: '0'
|
81
|
-
segments:
|
82
|
-
- 0
|
83
|
-
hash: 4225103840965744354
|
84
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
-
none: false
|
86
78
|
requirements:
|
87
|
-
- -
|
79
|
+
- - '>='
|
88
80
|
- !ruby/object:Gem::Version
|
89
81
|
version: '0'
|
90
|
-
segments:
|
91
|
-
- 0
|
92
|
-
hash: 4225103840965744354
|
93
82
|
requirements: []
|
94
83
|
rubyforge_project: page_naigation
|
95
|
-
rubygems_version:
|
84
|
+
rubygems_version: 2.0.0
|
96
85
|
signing_key:
|
97
|
-
specification_version:
|
86
|
+
specification_version: 4
|
98
87
|
summary: Provides basic navigation through a collection of items that use the PageObject
|
99
88
|
pattern.
|
100
89
|
test_files:
|
data/.rvmrc
DELETED