deas 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/deas/template.rb CHANGED
@@ -8,6 +8,10 @@ module Deas
8
8
  Deas::Template::RenderScope.class_eval{ include *helper_modules }
9
9
  end
10
10
 
11
+ def self.helper?(helper_module)
12
+ Deas::Template::RenderScope.included_modules.include?(helper_module)
13
+ end
14
+
11
15
  attr_reader :name, :options
12
16
 
13
17
  def initialize(sinatra_call, name, options = nil)
data/lib/deas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Deas
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -13,7 +13,7 @@ class Deas::Template
13
13
  subject{ @template }
14
14
 
15
15
  should have_instance_methods :name, :options, :render
16
- should have_class_methods :helpers
16
+ should have_class_methods :helpers, :helper?
17
17
 
18
18
  should "symbolize it's name" do
19
19
  assert_equal :"users/index", subject.name
@@ -30,12 +30,15 @@ class Deas::Template
30
30
  assert_equal subject.options, return_value[1]
31
31
  end
32
32
 
33
- should "include modules on the RenderScope using helpers class method" do
33
+ should "include modules on the RenderScope using `helpers` class method"\
34
+ " and know if a given modules has been included in the RenderScope" do
34
35
  helper_module = Module.new
35
36
  Deas::Template.helpers(helper_module)
36
37
 
37
38
  included_modules = Deas::Template::RenderScope.included_modules
38
39
  assert_includes helper_module, included_modules
40
+
41
+ assert Deas::Template.helper?(helper_module)
39
42
  end
40
43
 
41
44
  end
@@ -69,8 +72,7 @@ class Deas::Template
69
72
  end
70
73
  subject{ @render_scope }
71
74
 
72
- should have_instance_methods :partial, :escape_html, :h, :escape_url, :u,
73
- :render
75
+ should have_imeths :partial, :escape_html, :h, :escape_url, :u, :render
74
76
 
75
77
  should "call the sinatra_call's erb method with #partial" do
76
78
  return_value = subject.partial('part', :something => true)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deas
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 5
8
+ - 6
9
9
  - 0
10
- version: 0.5.0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kelly Redding