fracture 0.10.1 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +5 -0
- data/README.md +7 -2
- data/lib/fracture/fracture.rb +1 -0
- data/lib/fracture/version.rb +1 -1
- data/spec/fracture_spec.rb +16 -0
- metadata +3 -2
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Fracture
|
1
|
+
# Fracture [](http://badge.fury.io/rb/fracture)
|
2
2
|
Unified view testing for your view or controller specs.
|
3
3
|
|
4
4
|
Fracture allows you to define text or selector once at the top of a spec file. It also allows grouping of multiple text or selectors snippets using one label.
|
@@ -84,7 +84,7 @@ describe ContactsController do
|
|
84
84
|
it "index" do
|
85
85
|
login_as :user # psuedo code for example
|
86
86
|
get :index
|
87
|
-
response.body.
|
87
|
+
response.body.should_not have_fracture(:add)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
@@ -105,6 +105,10 @@ Fracture.define_text(:edits, "Edit", "Edit All")
|
|
105
105
|
```ruby
|
106
106
|
Fracture.define_selector(:label_1, "#an_id", ".a_class", ".another_class")
|
107
107
|
```
|
108
|
+
If the items is left blank then the label will be used as the item as an id selector
|
109
|
+
```ruby
|
110
|
+
Fracture.define_selector(:label_1) # equiv. Fracture.define_selector(:label_1, '#label_1')
|
111
|
+
```
|
108
112
|
|
109
113
|
Currently there is no way to build text and selectors into one definition (future feature). Another future feature will be to support 'within'.
|
110
114
|
|
@@ -179,6 +183,7 @@ page.body.should have_only_fractures(:label_2)
|
|
179
183
|
|
180
184
|
* Support text and selector in one fracture
|
181
185
|
* Support qty of expected fractures on page (selector count)
|
186
|
+
* Support Rake task to display matrix of context and fractures (to see if all are covered)
|
182
187
|
|
183
188
|
## Contributing
|
184
189
|
|
data/lib/fracture/fracture.rb
CHANGED
data/lib/fracture/version.rb
CHANGED
data/spec/fracture_spec.rb
CHANGED
@@ -14,6 +14,22 @@ describe Fracture do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
context 'items' do
|
18
|
+
context 'items blank on define_selector' do
|
19
|
+
it 'should set item to label name starting with #' do
|
20
|
+
Fracture.define_selector(:hello).items.should == ['#hello']
|
21
|
+
end
|
22
|
+
end
|
23
|
+
context 'when items set' do
|
24
|
+
it 'should set item' do
|
25
|
+
Fracture.define_selector(:hello, '#meme').items.should == ['#meme']
|
26
|
+
end
|
27
|
+
it 'should set multiple items' do
|
28
|
+
Fracture.define_selector(:hello, '#meme', '.wtf').items.should == ['#meme', '.wtf']
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
17
33
|
context "with data" do
|
18
34
|
before do
|
19
35
|
@first = Fracture.define_text(:a, "a")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fracture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.1
|
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-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -70,6 +70,7 @@ extensions: []
|
|
70
70
|
extra_rdoc_files: []
|
71
71
|
files:
|
72
72
|
- .gitignore
|
73
|
+
- CHANGELOG.md
|
73
74
|
- Gemfile
|
74
75
|
- README.md
|
75
76
|
- Rakefile
|