poser 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,8 +8,10 @@ module Poser
8
8
  end
9
9
 
10
10
  module ClassMethods
11
+ attr_writer :presenter_class
12
+
11
13
  def presenter_class
12
- Util.first_available_class(
14
+ @presenter_class ||= Util.first_available_class(
13
15
  "#{self}::Presenter",
14
16
  "#{self}Presenter",
15
17
  "Poser::Presenter"
@@ -1,3 +1,3 @@
1
1
  module Poser
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -8,10 +8,7 @@ describe Poser::Presentable do
8
8
  subject { C }
9
9
 
10
10
  describe "presenter_class" do
11
- after :all do
12
- Object.send :remove_const, :CPresenter
13
- C.send :remove_const, :Presenter
14
- end
11
+ before { subject.presenter_class = nil }
15
12
 
16
13
  it "returns Poser::Presenter when no presenter classes are available for this class" do
17
14
  subject.presenter_class.should == Poser::Presenter
@@ -20,11 +17,15 @@ describe Poser::Presentable do
20
17
  it "returns CPresenter if it exists" do
21
18
  CPresenter = Class.new
22
19
  subject.presenter_class.should == CPresenter
20
+ Object.send :remove_const, :CPresenter
23
21
  end
24
22
 
25
23
  it "returns the Presenter class namespaced under this class if it exists" do
24
+ CPresenter = Class.new
26
25
  C::Presenter = Class.new
27
26
  subject.presenter_class.should == C::Presenter
27
+ C.send :remove_const, :Presenter
28
+ Object.send :remove_const, :CPresenter
28
29
  end
29
30
  end
30
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: