capybara-extensions 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -10,4 +10,5 @@ group :development do
10
10
  gem "bundler", "~> 1.0.0"
11
11
  gem "jeweler", "~> 1.6.4"
12
12
  gem "rcov", ">= 0"
13
+ gem "capybara"
13
14
  end
data/Gemfile.lock CHANGED
@@ -1,20 +1,45 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
+ capybara (1.1.2)
5
+ mime-types (>= 1.16)
6
+ nokogiri (>= 1.3.3)
7
+ rack (>= 1.0.0)
8
+ rack-test (>= 0.5.4)
9
+ selenium-webdriver (~> 2.0)
10
+ xpath (~> 0.1.4)
11
+ childprocess (0.3.1)
12
+ ffi (~> 1.0.6)
13
+ ffi (1.0.11)
4
14
  git (1.2.5)
5
15
  jeweler (1.6.4)
6
16
  bundler (~> 1.0)
7
17
  git (>= 1.2.5)
8
18
  rake
19
+ mime-types (1.17.2)
20
+ multi_json (1.1.0)
21
+ nokogiri (1.5.2)
22
+ rack (1.4.1)
23
+ rack-test (0.6.1)
24
+ rack (>= 1.0)
9
25
  rake (0.9.2.2)
10
26
  rcov (0.9.11)
27
+ rubyzip (0.9.6.1)
28
+ selenium-webdriver (2.20.0)
29
+ childprocess (>= 0.2.5)
30
+ ffi (~> 1.0)
31
+ multi_json (~> 1.0)
32
+ rubyzip
11
33
  shoulda (2.11.3)
34
+ xpath (0.1.4)
35
+ nokogiri (~> 1.3)
12
36
 
13
37
  PLATFORMS
14
38
  ruby
15
39
 
16
40
  DEPENDENCIES
17
41
  bundler (~> 1.0.0)
42
+ capybara
18
43
  jeweler (~> 1.6.4)
19
44
  rcov
20
45
  shoulda
@@ -1,9 +1,17 @@
1
- = capybara-extensions
1
+ # capybara-extensions
2
2
 
3
- Description goes here.
3
+ Adds the following methods to Capybara::Node::Finders
4
+
5
+ * parent
6
+
7
+ ## Usage
8
+
9
+ gem 'capybara-extensions'
10
+
11
+ require 'capybara-extensions'
12
+
13
+ ## Contributing to capybara-extensions
4
14
 
5
- == Contributing to capybara-extensions
6
-
7
15
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
16
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
17
  * Fork the project
@@ -12,8 +20,7 @@ Description goes here.
12
20
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
21
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
22
 
15
- == Copyright
23
+ ## Copyright
16
24
 
17
25
  Copyright (c) 2012 Andy Waite. See LICENSE.txt for
18
26
  further details.
19
-
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ Jeweler::Tasks.new do |gem|
21
21
  gem.description = %Q{Some useful extensions to Capybara}
22
22
  gem.email = "andy@andywaite.com"
23
23
  gem.authors = ["Andy Waite"]
24
- # dependencies defined in Gemfile
24
+ gem.add_dependency 'capybara'
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
27
27
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "capybara-extensions"
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andy Waite"]
@@ -14,14 +14,14 @@ Gem::Specification.new do |s|
14
14
  s.email = "andy@andywaite.com"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
- "README.rdoc"
17
+ "README.md"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
21
  "Gemfile",
22
22
  "Gemfile.lock",
23
23
  "LICENSE.txt",
24
- "README.rdoc",
24
+ "README.md",
25
25
  "Rakefile",
26
26
  "VERSION",
27
27
  "capybara-extensions.gemspec",
@@ -43,17 +43,23 @@ Gem::Specification.new do |s|
43
43
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
44
44
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
45
45
  s.add_development_dependency(%q<rcov>, [">= 0"])
46
+ s.add_development_dependency(%q<capybara>, [">= 0"])
47
+ s.add_runtime_dependency(%q<capybara>, [">= 0"])
46
48
  else
47
49
  s.add_dependency(%q<shoulda>, [">= 0"])
48
50
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
49
51
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
50
52
  s.add_dependency(%q<rcov>, [">= 0"])
53
+ s.add_dependency(%q<capybara>, [">= 0"])
54
+ s.add_dependency(%q<capybara>, [">= 0"])
51
55
  end
52
56
  else
53
57
  s.add_dependency(%q<shoulda>, [">= 0"])
54
58
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
55
59
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
56
60
  s.add_dependency(%q<rcov>, [">= 0"])
61
+ s.add_dependency(%q<capybara>, [">= 0"])
62
+ s.add_dependency(%q<capybara>, [">= 0"])
57
63
  end
58
64
  end
59
65
 
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require 'capybara'
3
+
4
+ module Capybara
5
+ module Node
6
+ module Finders
7
+ def parent
8
+ find(:xpath, '..')
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,7 +1,13 @@
1
1
  require 'helper'
2
2
 
3
3
  class TestCapybaraExtensions < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
4
+ should "find a node's parent" do
5
+ html = <<-EOM
6
+ <div id="parent">a<div id="child">b</div>
7
+ EOM
8
+
9
+ doc = Capybara.string(html)
10
+ assert_equal doc.find('#child').parent[:id], 'parent'
11
+
6
12
  end
7
13
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-extensions
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Waite
@@ -77,6 +77,34 @@ dependencies:
77
77
  name: rcov
78
78
  prerelease: false
79
79
  type: :development
80
+ - !ruby/object:Gem::Dependency
81
+ requirement: &id005 !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ version_requirements: *id005
91
+ name: capybara
92
+ prerelease: false
93
+ type: :development
94
+ - !ruby/object:Gem::Dependency
95
+ requirement: &id006 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ hash: 3
101
+ segments:
102
+ - 0
103
+ version: "0"
104
+ version_requirements: *id006
105
+ name: capybara
106
+ prerelease: false
107
+ type: :runtime
80
108
  description: Some useful extensions to Capybara
81
109
  email: andy@andywaite.com
82
110
  executables: []
@@ -85,13 +113,13 @@ extensions: []
85
113
 
86
114
  extra_rdoc_files:
87
115
  - LICENSE.txt
88
- - README.rdoc
116
+ - README.md
89
117
  files:
90
118
  - .document
91
119
  - Gemfile
92
120
  - Gemfile.lock
93
121
  - LICENSE.txt
94
- - README.rdoc
122
+ - README.md
95
123
  - Rakefile
96
124
  - VERSION
97
125
  - capybara-extensions.gemspec