alephant 0.0.9.7-java → 0.0.9.8-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ff0e13461b2cea58a931cebb4868520bbbc34df
4
- data.tar.gz: 2b4b52fc0b91968f0276458a8862fe68d35c2407
3
+ metadata.gz: 9431f717738595e68a8a0c3b1bcd8f66cba57233
4
+ data.tar.gz: 1befa37fc85eb905ec085cdded713ce2192f1317
5
5
  SHA512:
6
- metadata.gz: 437b33a9f5452daa6770c1463a2ea6928875c4cbfc533484e069554e9ad67bf29f3b21f753cf245242aa3bfb662dd4e2c567b16e94da34a26f3c88a143bc7848
7
- data.tar.gz: 31930b9e797a79abda64fc91c376662c49aad4199e2fdcb82af4fb6b4576a2446d9b8eba2d993d8208f0cfddf2177d10b50e9f6ffd769f6c7924ccd7bdd5f15f
6
+ metadata.gz: 2c7f72b93b915b929ffc5aaae66326d89e7cafbdf6f0ce48348ba5d7b8d1276d7e8448e87deb0d97dc5edcb7994136aa7a5d4c8c352d9729e4b44ef26d04e502
7
+ data.tar.gz: c8ac8b48eb497dad1d0b43eee8daec450a800ca87367c509abb5b502f3c6f7d8a4a2c2667f6b1647deb798f57f34fca52d3d62b53355463658c2c36675ebd7a1
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "jruby-19mode"
3
+ - "jruby"
4
4
  notifications:
5
5
  email:
6
6
  recipients:
@@ -1,3 +1,3 @@
1
1
  module Alephant
2
- VERSION = "0.0.9.7"
2
+ VERSION = "0.0.9.8"
3
3
  end
@@ -1,15 +1,21 @@
1
-
2
1
  require 'spec_helper'
3
2
 
4
3
  describe Alephant::MultiRenderer do
5
4
  let(:component_id) { :foo }
5
+ let(:data) {{ :foo => :bar }}
6
+
6
7
  subject { Alephant::MultiRenderer }
7
8
 
9
+ before(:each) do
10
+ File.stub(:directory?).and_return(true)
11
+ end
12
+
8
13
  describe "initialize(view_base_path)" do
9
14
  context "view_base_path = invalid_path" do
10
15
  it "should raise InvalidViewPath" do
16
+ File.stub(:directory?).and_return(false)
11
17
  expect {
12
- instance = subject.new(component_id, './invalid_path')
18
+ subject.new(component_id, './invalid_path')
13
19
  }.to raise_error(
14
20
  Alephant::Errors::InvalidViewPath
15
21
  )
@@ -18,7 +24,6 @@ describe Alephant::MultiRenderer do
18
24
 
19
25
  context "view_base_path = '.'" do
20
26
  it "sets base_path" do
21
- File.stub(:directory?).and_return(true)
22
27
  expect(subject.new(component_id, '.').base_path).to eq("./#{component_id}")
23
28
  end
24
29
  end
@@ -31,73 +36,53 @@ describe Alephant::MultiRenderer do
31
36
  end
32
37
 
33
38
  describe "render_template(template_file, data, instance = nil)" do
34
- before(:each) do
35
- File.stub(:directory?).and_return(true)
36
- end
37
-
38
39
  context "instance is not nil" do
39
- let(:data) {{ :foo => :bar }}
40
-
41
40
  it "renders the specified template" do
42
41
  Alephant::MultiRenderer.any_instance.stub(:create_instance)
43
42
  Alephant::Renderer.any_instance.stub(:render).and_return('content')
44
43
 
45
44
  expect(
46
45
  subject.new(component_id, '.')
47
- .render_template('foo', data)
46
+ .render_template('foo', data)
48
47
  ).to eq('content')
49
48
  end
50
49
  end
51
50
  end
52
51
 
53
52
  describe "render(data)" do
54
- before(:each) do
55
- File.stub(:directory?).and_return(true)
56
- end
57
-
58
- it "calls ::Alephant::renderer.render() for each template found" do
59
- Alephant::MultiRenderer.any_instance.stub(:create_instance)
60
- Alephant::Renderer.any_instance.stub(:render).and_return('content')
61
-
62
- Dir.stub(:glob).and_return(['/some/path/foo.mustache', '/some/path/bar.mustache'])
63
-
64
- templates = {
65
- :foo => 'content',
66
- :bar => 'content'
67
- }
68
-
69
- instance = subject.new(component_id, '.')
70
-
71
- content = instance.render({ :foo => :bar })
72
-
73
- expect(content.size).to eq(2)
74
-
75
- content.each do |template_type, rendered_content|
76
- expect(rendered_content).to eq(templates[template_type])
77
- end
53
+ it "calls render_template for each template found" do
54
+ Alephant::MultiRenderer.any_instance.stub(:render_template)
55
+ Alephant::MultiRenderer.any_instance.stub(
56
+ :template_locations
57
+ ).and_return(['foo', 'bar'])
58
+
59
+ expect(
60
+ subject.new(component_id, '.').render(data).size
61
+ ).to eq(2)
78
62
  end
79
63
  end
80
64
 
81
65
  describe "create_instance(template_file, data)" do
82
- before(:each) do
83
- File.stub(:directory?).and_return(true)
84
- end
85
-
86
- let(:data) {{ :key => :value }}
87
-
88
66
  it "returns the model" do
89
- instance = subject.new(component_id, 'fixtures/components')
90
- model = instance.create_instance('foo', data)
67
+ model = subject.new(
68
+ component_id,
69
+ 'fixtures/components'
70
+ ).create_instance('foo', data)
71
+
91
72
  model.should be_an Alephant::Views::Base
92
73
  expect(model.data).to eq(data)
93
74
  end
94
75
 
95
76
  context "invalid model" do
96
77
  it 'should raise ViewModelNotFound' do
97
- instance = subject.new(component_id, @base_path)
98
-
99
78
  expect {
100
- instance.create_instance('invalid_model', data)
79
+ subject.new(
80
+ component_id,
81
+ @base_path
82
+ ).create_instance(
83
+ 'invalid_model',
84
+ data
85
+ )
101
86
  }.to raise_error(
102
87
  Alephant::Errors::ViewModelNotFound
103
88
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.7
4
+ version: 0.0.9.8
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Kenny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec