rspec-cells 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/Appraisals +1 -1
- data/CHANGES.textile +6 -1
- data/MIT-LICENSE +2 -1
- data/README.rdoc +19 -2
- data/gemfiles/rspec2.gemfile +1 -1
- data/lib/generators/rspec/cell_generator.rb +3 -0
- data/lib/generators/rspec/templates/cell_spec.erb +1 -1
- data/lib/rspec/cells/caching.rb +29 -0
- data/lib/rspec/cells/tasks.rake +1 -0
- data/lib/rspec/cells/version.rb +1 -1
- data/lib/rspec/cells.rb +1 -0
- data/rspec-cells.gemspec +1 -1
- data/spec/cells/caching_spec.rb +13 -0
- data/spec/spec_helper.rb +0 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed05686b72ee47371a5a7d6b5a50d7e0ab256b6a
|
4
|
+
data.tar.gz: 7fcf7b3f409de782f98d2f3a8ec8f3641b94ca38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d046919ad6c50ff2326bfb31c00d4238aabaa3e1c6d2fdfc94321c7bd48b75edb3a0ab3a9cba1cc17cb56157ea3e44f062c688ec49936f3a000fcffe13e1e9d
|
7
|
+
data.tar.gz: 30ce8f0aa270760828eeefb4469acda3909a54ee8f9c931851ee5821dbe310730a3548f96164bebaaabc0acbb9bb0f3ba7867895910d7ca17cef82931959785e
|
data/Appraisals
CHANGED
data/CHANGES.textile
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
h2. 0.2.1
|
2
|
+
|
3
|
+
* Relaxed rspec dependency to >= 2.14.
|
4
|
+
* Added `enable_cell_caching!` for specs.
|
5
|
+
|
1
6
|
h2. 0.2.0
|
2
7
|
|
3
|
-
* rspec-cells
|
8
|
+
* rspec-cells depends on rspec >= 2.99 and uses the expect syntax. Thanks to @seuros for his help.
|
4
9
|
|
5
10
|
h2. 0.1.12
|
6
11
|
|
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -18,7 +18,8 @@ This gem runs with RSpec2 and Rails >= 3.x, so just add it to your app's +Gemfil
|
|
18
18
|
|
19
19
|
= Usage
|
20
20
|
|
21
|
-
Simply put all your specs in the <tt>spec/cells</tt> directory
|
21
|
+
Simply put all your specs in the <tt>spec/cells</tt> directory or add type: :cell to the describe block.
|
22
|
+
However, let the cell generator do that for you!
|
22
23
|
|
23
24
|
rails g cell blog_post show -t rspec
|
24
25
|
|
@@ -105,14 +106,30 @@ Run your examples with
|
|
105
106
|
|
106
107
|
If you need more helpers, matchers and stuff, {just let us know}[http://cells.rubyforge.org/community.html].
|
107
108
|
|
109
|
+
== Test cells with caching
|
110
|
+
|
111
|
+
By default your code for caching code is not run if you set <tt>ActionController::Base.perform_caching = false</tt>
|
112
|
+
That's a reasonable default but you might want to increase coverage by running caching code at least once.
|
113
|
+
Here is an example:
|
114
|
+
|
115
|
+
describe SomeCell do
|
116
|
+
describe 'caching' do
|
117
|
+
enable_cell_caching!
|
118
|
+
# Code for testing...
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
|
108
123
|
== Contributors
|
109
124
|
|
110
125
|
* Jorge Calás Lozano <calas@qvitta.net> (Cleanup, capybara string matchers)
|
126
|
+
* Abdelkader Boudih <@seuros>
|
127
|
+
*
|
111
128
|
|
112
129
|
== LICENSE
|
113
130
|
|
114
131
|
Copyright (c) 2010, Nick Sutterer
|
115
132
|
|
116
|
-
Copyright (c)
|
133
|
+
Copyright (c) 2008-2009, Dmytro Shteflyuk <kpumuk@kpumuk.info> http://kpumuk.info
|
117
134
|
|
118
135
|
Released under the MIT License.
|
data/gemfiles/rspec2.gemfile
CHANGED
@@ -7,7 +7,7 @@ describe <%= class_name %>Cell, type: :cell do
|
|
7
7
|
context 'rendering <%= state %>' do
|
8
8
|
subject { render_cell(<%= cell_name %>, :<%= state %>) }
|
9
9
|
|
10
|
-
<%- if defined?(Capybara) -%>
|
10
|
+
<%- if defined?(::Capybara) -%>
|
11
11
|
it { is_expected.to have_selector('h1', text: '<%= class_name %>#<%= state %>') }
|
12
12
|
it { is_expected.to have_selector('p', text: 'Find me in app/cells/<%= file_path %>/<%= state %>.html') }
|
13
13
|
<%- else -%>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module RSpec
|
2
|
+
module Cells
|
3
|
+
module Caching
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
module ClassMethods
|
7
|
+
def enable_cell_caching!
|
8
|
+
before :each do
|
9
|
+
ActionController::Base.perform_caching = true
|
10
|
+
end
|
11
|
+
after :each do
|
12
|
+
ActionController::Base.perform_caching = false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def disable_cell_caching!
|
17
|
+
before :each do
|
18
|
+
ActionController::Base.perform_caching = false
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
RSpec.configure do |c|
|
27
|
+
c.include RSpec::Cells::Caching, type: :cell
|
28
|
+
end
|
29
|
+
|
data/lib/rspec/cells/tasks.rake
CHANGED
data/lib/rspec/cells/version.rb
CHANGED
data/lib/rspec/cells.rb
CHANGED
data/rspec-cells.gemspec
CHANGED
@@ -20,6 +20,6 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
22
|
s.add_runtime_dependency "railties", ">= 3.0"
|
23
|
-
s.add_runtime_dependency 'rspec-rails', '>= 2.
|
23
|
+
s.add_runtime_dependency 'rspec-rails', '>= 2.14'
|
24
24
|
s.add_runtime_dependency "cells", ">= 3.4.0"
|
25
25
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Caching' do
|
4
|
+
let(:subject) { self.class }
|
5
|
+
|
6
|
+
it 'module is included' do
|
7
|
+
expect(subject.included_modules).to include(RSpec::Cells::Caching)
|
8
|
+
end
|
9
|
+
|
10
|
+
it { expect(subject).to respond_to(:enable_cell_caching!) }
|
11
|
+
it { expect(subject).to respond_to(:disable_cell_caching!) }
|
12
|
+
|
13
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-cells
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.14'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.14'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: cells
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,10 +73,12 @@ files:
|
|
73
73
|
- lib/generators/rspec/templates/cell_spec.erb
|
74
74
|
- lib/rspec-cells.rb
|
75
75
|
- lib/rspec/cells.rb
|
76
|
+
- lib/rspec/cells/caching.rb
|
76
77
|
- lib/rspec/cells/cell_example_group.rb
|
77
78
|
- lib/rspec/cells/tasks.rake
|
78
79
|
- lib/rspec/cells/version.rb
|
79
80
|
- rspec-cells.gemspec
|
81
|
+
- spec/cells/caching_spec.rb
|
80
82
|
- spec/cells/cell_generator_spec.rb
|
81
83
|
- spec/cells/cell_spec_spec.rb
|
82
84
|
- spec/spec_helper.rb
|
@@ -105,6 +107,7 @@ signing_key:
|
|
105
107
|
specification_version: 4
|
106
108
|
summary: Spec your cells.
|
107
109
|
test_files:
|
110
|
+
- spec/cells/caching_spec.rb
|
108
111
|
- spec/cells/cell_generator_spec.rb
|
109
112
|
- spec/cells/cell_spec_spec.rb
|
110
113
|
- spec/spec_helper.rb
|