poser 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.3
4
+ - 1.9.2
5
+ - jruby
6
+ - rbx
7
+ script: "bundle exec rspec spec"
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  A minimal implementation of the presenter pattern.
4
4
 
5
+ [![Build Status](https://secure.travis-ci.org/austinthecoder/poser.png?branch=master)](http://travis-ci.org/austinthecoder/poser)
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -38,5 +38,9 @@ module Poser
38
38
  other.is_a?(self.class) && context == other.context && __getobj__ == other.__getobj__
39
39
  end
40
40
 
41
+ def is_a?(klass)
42
+ super || __getobj__.is_a?(klass)
43
+ end
44
+
41
45
  end
42
46
  end
@@ -1,3 +1,3 @@
1
1
  module Poser
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -10,6 +10,14 @@ describe Poser::Presenter do
10
10
  @context = Object.new
11
11
  end
12
12
 
13
+ it "returns the object if it's not truthy" do
14
+ @object = nil
15
+ subject.present(@object, @context).should === @object
16
+
17
+ @object = false
18
+ subject.present(@object, @context).should === @object
19
+ end
20
+
13
21
  it "returns the object if it's presented" do
14
22
  @object.stub(:presented?) { true }
15
23
  subject.present(@object, @context).should == @object
@@ -68,5 +76,13 @@ describe Poser::Presenter do
68
76
  subject.present(object).should == result
69
77
  end
70
78
  end
79
+
80
+ describe "is_a?" do
81
+ it "is true with it's class or it's presentee's class" do
82
+ @presentee = ""
83
+ subject.is_a?(String).should be_true
84
+ subject.is_a?(Poser::Presenter).should be_true
85
+ end
86
+ end
71
87
  end
72
88
  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.4
4
+ version: 1.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-10 00:00:00.000000000 Z
12
+ date: 2012-04-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -35,6 +35,7 @@ extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
37
  - .gitignore
38
+ - .travis.yml
38
39
  - Gemfile
39
40
  - LICENSE
40
41
  - README.md