tourbus 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/tour.rb +7 -58
- metadata +4 -3
data/README.rdoc
CHANGED
data/lib/tour.rb
CHANGED
@@ -11,75 +11,24 @@ require 'test/unit/assertions'
|
|
11
11
|
# paths through a specific area of your website, define a tour for
|
12
12
|
# that area and create test_ methods for each type of test to be done.
|
13
13
|
|
14
|
+
Webrat.configure do |config|
|
15
|
+
config.mode = :mechanize
|
16
|
+
end
|
17
|
+
|
14
18
|
class Tour
|
15
19
|
extend Forwardable
|
20
|
+
include Webrat::Methods
|
16
21
|
include Webrat::Matchers
|
17
22
|
include Webrat::SaveAndOpenPage
|
18
23
|
include Test::Unit::Assertions
|
19
24
|
|
20
|
-
attr_reader :host, :tours, :number, :tour_type, :tour_id
|
21
|
-
|
22
|
-
# delegate goodness to webrat
|
23
|
-
[
|
24
|
-
:attach_file,
|
25
|
-
:attaches_file,
|
26
|
-
:automate,
|
27
|
-
:basic_auth,
|
28
|
-
:check,
|
29
|
-
:check_for_infinite_redirects,
|
30
|
-
:checks,
|
31
|
-
:choose,
|
32
|
-
:chooses,
|
33
|
-
:click_area,
|
34
|
-
:click_button,
|
35
|
-
:click_link,
|
36
|
-
:click_link_within,
|
37
|
-
:clicks_area,
|
38
|
-
:clicks_button,
|
39
|
-
:clicks_link,
|
40
|
-
:current_page,
|
41
|
-
:dom,
|
42
|
-
:field_by_xpath,
|
43
|
-
:field_labeled,
|
44
|
-
:field_with_id,
|
45
|
-
:fill_in,
|
46
|
-
:fills_in,
|
47
|
-
:get,
|
48
|
-
:header,
|
49
|
-
:http_accept,
|
50
|
-
:infinite_redirect_limit_exceeded?,
|
51
|
-
:internal_redirect?,
|
52
|
-
:redirected_to,
|
53
|
-
:reload,
|
54
|
-
:response_body,
|
55
|
-
:select,
|
56
|
-
:select_date,
|
57
|
-
:select_datetime,
|
58
|
-
:select_option,
|
59
|
-
:select_time,
|
60
|
-
:selects,
|
61
|
-
:selects_date,
|
62
|
-
:selects_datetime,
|
63
|
-
:selects_time,
|
64
|
-
:set_hidden_field,
|
65
|
-
:simulate,
|
66
|
-
:submit_form,
|
67
|
-
:uncheck,
|
68
|
-
:unchecks,
|
69
|
-
:within,
|
70
|
-
:xml_content_type?
|
71
|
-
].each {|m| def_delegators(:webrat_session, m) }
|
72
|
-
|
25
|
+
attr_reader :host, :tours, :number, :tour_type, :tour_id
|
26
|
+
|
73
27
|
def initialize(host, tours, number, tour_id)
|
74
28
|
@host, @tours, @number, @tour_id = host, tours, number, tour_id
|
75
29
|
@tour_type = self.send(:class).to_s
|
76
|
-
@webrat_session = Webrat::MechanizeAdapter.new()
|
77
30
|
end
|
78
31
|
|
79
|
-
def visit(url, data=nil)
|
80
|
-
get url, data
|
81
|
-
end
|
82
|
-
|
83
32
|
# before_tour runs once per tour, before any tests get run
|
84
33
|
def before_tour; end
|
85
34
|
|
metadata
CHANGED
@@ -5,19 +5,20 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 5
|
9
|
+
version: 0.1.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- David Brady
|
13
13
|
- James Britt
|
14
14
|
- JT Zemp
|
15
15
|
- Tim Harper
|
16
|
+
- Joe Tanner
|
16
17
|
autorequire:
|
17
18
|
bindir: bin
|
18
19
|
cert_chain: []
|
19
20
|
|
20
|
-
date: 2010-03-
|
21
|
+
date: 2010-03-29 00:00:00 -06:00
|
21
22
|
default_executable:
|
22
23
|
dependencies:
|
23
24
|
- !ruby/object:Gem::Dependency
|