cells 3.3.9 → 3.3.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,7 @@
1
+ - 3.3.10
2
+ * TestCase#render_cell now processes options properly.
3
+ * added TestCase#assigns.
4
+
1
5
  - 3.3.9
2
6
  * fixed loading test_case.rb
3
7
  * added TestCase#view_assigns
@@ -80,7 +80,7 @@ module Cell
80
80
  def render_cell(name, state, *args)
81
81
  @subject_cell = ::Cell::Base.create_cell_for(@controller, name, *args)
82
82
  @view_assigns = extract_state_ivars_for(@subject_cell) do
83
- @last_invoke = @subject_cell.render_state(state, *args)
83
+ @last_invoke = @subject_cell.render_state(state)
84
84
  end
85
85
 
86
86
  @last_invoke
@@ -109,6 +109,10 @@ module Cell
109
109
  cell.instance_eval &block if block_given?
110
110
  cell
111
111
  end
112
+
113
+ def assigns(name)
114
+ view_assigns[name.to_sym]
115
+ end
112
116
  end
113
117
 
114
118
  include TestMethods
data/lib/cells/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cells
2
- VERSION = '3.3.9'
2
+ VERSION = '3.3.10'
3
3
  end
@@ -48,6 +48,17 @@ class TestCaseTest < Cell::TestCase
48
48
  render_cell(:bassist, :sleep)
49
49
  assert_equal({:duration => "8h"}, view_assigns)
50
50
  end
51
+
52
+ should "return the instance variables from the last #render_cell accepting options" do
53
+ BassistCell.class_eval do
54
+ def run
55
+ @duration = @opts[:duration]
56
+ end
57
+ end
58
+ render_cell(:bassist, :run, :duration=> "8h")
59
+ assert_equal("8h", assigns(:duration))
60
+ end
61
+
51
62
  end
52
63
 
53
64
  context "in declarative tests" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 3
7
7
  - 3
8
- - 9
9
- version: 3.3.9
8
+ - 10
9
+ version: 3.3.10
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-10-06 00:00:00 +02:00
17
+ date: 2011-11-08 00:00:00 -02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency