rspec-cells 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/.travis.yml +4 -0
- data/CHANGES.textile +5 -0
- data/Gemfile +2 -0
- data/README.rdoc +2 -0
- data/Rakefile +5 -0
- data/lib/rspec/cells/version.rb +1 -1
- data/lib/rspec/rails/example/cell_example_group.rb +0 -2
- data/rspec-cells.gemspec +1 -1
- data/spec/cells/cell_spec_spec.rb +26 -4
- metadata +4 -17
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/CHANGES.textile
CHANGED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
<em>Spec your Cells.</em>
|
4
4
|
|
5
|
+
{<img src="https://secure.travis-ci.org/apotonick/rspec-cells.png" />}[http://travis-ci.org/apotonick/rspec-cells]
|
6
|
+
|
5
7
|
This plugin allows you to test your cells easily using RSpec. Basically, it adds a cells example group with a <tt>#render_cell</tt> helper.
|
6
8
|
|
7
9
|
Cells is Rails' popular {view components framework}[http://github.com/apotonick/cells].
|
data/Rakefile
CHANGED
data/lib/rspec/cells/version.rb
CHANGED
@@ -6,7 +6,6 @@ module RSpec::Rails
|
|
6
6
|
|
7
7
|
include RSpec::Rails::RailsExampleGroup
|
8
8
|
include Cell::TestCase::TestMethods
|
9
|
-
include RSpec::Rails::ViewRendering
|
10
9
|
|
11
10
|
if defined?(Webrat)
|
12
11
|
include Webrat::Matchers
|
@@ -52,7 +51,6 @@ module RSpec::Rails
|
|
52
51
|
end
|
53
52
|
|
54
53
|
# we always render views in rspec-cells, so turn it on.
|
55
|
-
render_views
|
56
54
|
subject { controller }
|
57
55
|
end
|
58
56
|
|
data/rspec-cells.gemspec
CHANGED
@@ -1,20 +1,42 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'cells'
|
3
|
+
|
4
|
+
class DummyCell < Cell::Base
|
5
|
+
def show
|
6
|
+
"I'm Dummy."
|
7
|
+
end
|
8
|
+
|
9
|
+
def update(what)
|
10
|
+
"Updating #{what}."
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
2
14
|
|
3
15
|
module RSpec::Rails
|
4
|
-
|
16
|
+
|
5
17
|
describe CellExampleGroup do
|
6
18
|
let(:group) do
|
7
19
|
RSpec::Core::ExampleGroup.describe do
|
8
20
|
include CellExampleGroup
|
9
21
|
end
|
10
22
|
end
|
11
|
-
|
23
|
+
|
12
24
|
it "adds :type => :cell to the metadata" do
|
13
25
|
group.metadata[:type].should eq(:cell)
|
14
26
|
end
|
15
27
|
|
16
|
-
|
17
|
-
|
28
|
+
describe "#render_cell" do
|
29
|
+
it "renders a state" do
|
30
|
+
group.new.render_cell(:dummy, :show).should == "I'm Dummy."
|
31
|
+
end
|
32
|
+
|
33
|
+
it "allows passing state args" do
|
34
|
+
group.new.render_cell(:dummy, :update, "this").should == "Updating this."
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
it "responds to #cell" do
|
39
|
+
group.new.cell(:dummy).should be_kind_of(DummyCell)
|
18
40
|
end
|
19
41
|
end
|
20
42
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
|
9
|
-
version: 0.0.5
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nick Sutterer
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-10-04 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -45,20 +45,6 @@ dependencies:
|
|
45
45
|
version: "2.2"
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: cells
|
50
|
-
prerelease: false
|
51
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
|
-
requirements:
|
54
|
-
- - ~>
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
segments:
|
57
|
-
- 3
|
58
|
-
- 4
|
59
|
-
version: "3.4"
|
60
|
-
type: :runtime
|
61
|
-
version_requirements: *id003
|
62
48
|
description: Use render_cell in your specs.
|
63
49
|
email:
|
64
50
|
- apotonick@gmail.com
|
@@ -70,6 +56,7 @@ extra_rdoc_files: []
|
|
70
56
|
|
71
57
|
files:
|
72
58
|
- .gitignore
|
59
|
+
- .travis.yml
|
73
60
|
- CHANGES.textile
|
74
61
|
- Gemfile
|
75
62
|
- MIT-LICENSE
|