utensils 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -2
- data/lib/utensils/custom_matchers.rb +7 -5
- data/lib/utensils/version.rb +1 -1
- metadata +2 -8
data/README.md
CHANGED
@@ -72,10 +72,11 @@ Resets timecop after each spec
|
|
72
72
|
|
73
73
|
### upload_macros
|
74
74
|
|
75
|
-
Provides fixture_file helper pointing to spec/fixtures directory
|
75
|
+
Provides fixture_file and fixture_file_path helper pointing to spec/fixtures directory
|
76
76
|
|
77
77
|
```ruby
|
78
|
-
|
78
|
+
fixture_file_path('dummy.jpg') # 'spec/fixtures/dummy.jpg'
|
79
|
+
Photo.create(:file => fixture_file('dummy.jpg')) # attaches File spec/fixtures/dummy.jpg
|
79
80
|
```
|
80
81
|
|
81
82
|
### vcr
|
@@ -113,23 +113,25 @@ module Utensils
|
|
113
113
|
class Ordered
|
114
114
|
def initialize(args)
|
115
115
|
@within = args.pop[:within]
|
116
|
-
@
|
116
|
+
@selectors = args.map do |selector|
|
117
|
+
selector.is_a?(String) ? selector : '#' + ApplicationController.helpers.dom_id(selector)
|
118
|
+
end
|
117
119
|
end
|
118
120
|
|
119
121
|
def matches?(page)
|
120
122
|
@page = page
|
121
|
-
@
|
122
|
-
return false unless @page.has_css?("#{@within}
|
123
|
+
@selectors.each_with_index do |selector,i|
|
124
|
+
return false unless @page.has_css?("#{@within} #{selector}:nth-child(#{i+1})")
|
123
125
|
end
|
124
126
|
true
|
125
127
|
end
|
126
128
|
|
127
129
|
def failure_message_for_should
|
128
|
-
"expected #{@page.body} to have
|
130
|
+
"expected #{@page.body} to have elements in this order: #{@selectors.inspect}"
|
129
131
|
end
|
130
132
|
|
131
133
|
def failure_message_for_should_not
|
132
|
-
"expected #{@page.body} to not have
|
134
|
+
"expected #{@page.body} to not have elements in this order: #{@selectors.inspect}"
|
133
135
|
end
|
134
136
|
end
|
135
137
|
|
data/lib/utensils/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utensils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-03-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Rspec stuff we use over and over again
|
15
15
|
email:
|
@@ -46,18 +46,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
46
|
- - ! '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
|
-
segments:
|
50
|
-
- 0
|
51
|
-
hash: -1360619607075634307
|
52
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
51
|
requirements:
|
55
52
|
- - ! '>='
|
56
53
|
- !ruby/object:Gem::Version
|
57
54
|
version: '0'
|
58
|
-
segments:
|
59
|
-
- 0
|
60
|
-
hash: -1360619607075634307
|
61
55
|
requirements: []
|
62
56
|
rubyforge_project:
|
63
57
|
rubygems_version: 1.8.23
|