model_presenter 0.1.2 → 0.1.3

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: 05940fe80ea9e58a34676c0991c9532c080710e8
4
- data.tar.gz: 1ad556afcea1b61e6a7cb29341d1c70003179dbd
3
+ metadata.gz: 8960243c323183854459572fb01f3ce2603ccb3c
4
+ data.tar.gz: 39db1860055cbb03b98bf9f4d25df328d19c4028
5
5
  SHA512:
6
- metadata.gz: 6aa3f1383677fff6df64604ee89f1770feab7c9033fe6223292ef4c74a9b3e6ac7061205cb0c6a38d7c4958422e8d9a7abf2440c8ff073e11ebbf0cc6c6247fd
7
- data.tar.gz: 55ff124b55eb48585ff377e01ab0e4345597f19eb97e1c4bb92f7e8f30a194962817bb8bbdb209836a085db7f2b9d4d9a6faafc6be32b475c41ab4ec06909e93
6
+ metadata.gz: 1712e978c6de27ac0103298c6610acb2b2f7c2110b25d4d7cdcaf7898b394580078a3793d7e87538f93b4c66f3915606f9c1d63796b52ecc0d4d531711f2705d
7
+ data.tar.gz: 24f63f700a640f5ec417ea14f262c94b8bf1e3d7e88475ae6b79992b236f29ddff69140c1553910fd463df344afbd117d9d73f2a91283e7e72c8e259e6e2e886
data/.travis.yml CHANGED
@@ -3,3 +3,4 @@ script: "bundle exec rake test"
3
3
  rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
+ - 2.2.0
data/README.md CHANGED
@@ -174,3 +174,7 @@ User
174
174
  3. Commit your changes (`git commit -am 'Added some feature'`)
175
175
  4. Push to the branch (`git push origin my-new-feature`)
176
176
  5. Create new Pull Request
177
+
178
+
179
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ywen/model_presenter/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
180
+
@@ -1,3 +1,3 @@
1
1
  module ModelPresenter
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -3,14 +3,14 @@ module ModelPresenter
3
3
  module Macros
4
4
  def as_json_attributes(*keys)
5
5
  describe "#as_json" do
6
- let(:result) { subject.as_json }
6
+ let(:result) { presenter.as_json }
7
7
  keys.each do |key|
8
8
  context "having the key #{key}"
9
9
  it "has the key #{key} with value set to presenter.#{key}" do
10
10
  if result[key].respond_to?(:should)
11
- result[key].should eq(subject.send(key))
11
+ expect(result[key]).to eq(presenter.send(key))
12
12
  else
13
- expect(result[key]).to eq(subject.send(key))
13
+ expect(result[key]).to eq(presenter.send(key))
14
14
  end
15
15
  end
16
16
  end
@@ -5,10 +5,10 @@ module ModelPresenter
5
5
  attributes.each do |attribute|
6
6
  describe "##{attribute}" do
7
7
  it "returns the model.#{attribute}" do
8
- model.stub(attribute).and_return(attribute)
9
- result = subject.send(attribute)
8
+ allow(model).to receive(attribute).and_return(attribute)
9
+ result = presenter.send(attribute)
10
10
  if result.respond_to?(:should)
11
- result.should eq(model.send(attribute))
11
+ expect(result).to eq(model.send(attribute))
12
12
  else
13
13
  expect(result).to eq(model.send(attribute))
14
14
  end
@@ -3,8 +3,8 @@ module Macros
3
3
  def it_moneyize(*fields)
4
4
  fields.each do |field|
5
5
  describe "#formatted_#{field}" do
6
- let(:expected) { subject.send("formatted_#{field}") }
7
- let(:actual) { "$ #{subject.send(field).to_f/100}" }
6
+ let(:expected) { presenter.send("formatted_#{field}") }
7
+ let(:actual) { "$ #{presenter.send(field).to_f/100}" }
8
8
  it "returns the formatted money in dollar" do
9
9
  expect(expected).to eq( actual )
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yi Wen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-18 00:00:00.000000000 Z
11
+ date: 2015-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -133,7 +133,6 @@ files:
133
133
  - .gitignore
134
134
  - .rbenv-version
135
135
  - .ruby-version
136
- - .rvmrc.template
137
136
  - .travis.yml
138
137
  - CHANGELOG.md
139
138
  - Gemfile
@@ -202,4 +201,3 @@ test_files:
202
201
  - test/support/mock_base_class.rb
203
202
  - test/support/mock_model_object.rb
204
203
  - test/test_helper.rb
205
- has_rdoc:
data/.rvmrc.template DELETED
@@ -1 +0,0 @@
1
- rvm 1.9.3@model_presenter