horza 0.3.8 → 0.3.9

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: d8d3fdf41a58ccb7369f0b8e09d3acce48153a18
4
- data.tar.gz: 9f72bd021854a66312edb840906caf879a4fc146
3
+ metadata.gz: 05dec4f4ed4ea42ae1721a8b519496ec70f2a803
4
+ data.tar.gz: 3fbd9ab81b756c4e4666a5334d7dda52b44a6fca
5
5
  SHA512:
6
- metadata.gz: 67c1fadfe7ee3c049e250186f635738534b8e7390ca4729582dc08d796a1f7e615b15d2c850c1a1eaecf7bd7a17703cd22dbb82a12bf2d976bfb40efeeda6fef
7
- data.tar.gz: abfb49f9870eb1e49b0289cc9fa66aa3fcf364ffc2c48f09dc1cfef316008eefb9856c84779ef35ce7a8bd1c084eedc82f68406f1ad826dc6a9852db452effa1
6
+ metadata.gz: 3afecde1421ecf764dfb2b8ebe1a3f7450526632488fc052376e46c1f0f35d7b3fd8dec25f2465bd3a1db3f65dd3dbef2041064ef7f53c59f03e0f7d88b13179
7
+ data.tar.gz: 42e7183c12b8733dd2db997ebccb2df9741c3ef5e5dbf5b0f57c7ef01c1f33684b280698594e52ae5c53b57c41c14c30ad8831678474cf8d7e3b8ee958728640
@@ -14,7 +14,7 @@ module Horza
14
14
  def method_missing(method, &block)
15
15
  if [:length, :size, :empty?, :present?].include? method
16
16
  @collection.send(method)
17
- elsif [:first, :last].include? method
17
+ elsif [:first, :last, :pop].include? method
18
18
  singular_entity(@collection.send(method))
19
19
  elsif [:each, :map, :collect]
20
20
  enum_method(method, &block)
@@ -527,7 +527,7 @@ describe Horza do
527
527
 
528
528
  context '#each' do
529
529
  context 'when name is of ancestry type' do
530
- it 'yields a Get::Entities::Single with each iteration' do
530
+ it 'yields a Horza::Entities::Single with each iteration' do
531
531
  subject.each do |member|
532
532
  expect(member.is_a? Horza::Entities::Single).to be true
533
533
  end
@@ -537,7 +537,7 @@ describe Horza do
537
537
 
538
538
  context '#map' do
539
539
  context 'when name is of ancestry type' do
540
- it 'yields a Get::Entities::Single with each iteration, returns array' do
540
+ it 'yields a Horza::Entities::Single with each iteration, returns array' do
541
541
  map = subject.map(&:id)
542
542
  expect(map.is_a? Array).to be true
543
543
  expect(map.length).to eq 3
@@ -547,7 +547,7 @@ describe Horza do
547
547
 
548
548
  context '#collect' do
549
549
  context 'when name is of ancestry type' do
550
- it 'yields a Get::Entities::Single with each iteration, returns array' do
550
+ it 'yields a Horza::Entities::Single with each iteration, returns array' do
551
551
  map = subject.collect(&:id)
552
552
  expect(map.is_a? Array).to be true
553
553
  expect(map.length).to eq 3
@@ -555,6 +555,15 @@ describe Horza do
555
555
  end
556
556
  end
557
557
 
558
+ context '#pop' do
559
+ context 'when name is of ancestry type' do
560
+ it 'returns the last collection item as a Horza::Entities::Single' do
561
+ entity = subject.pop
562
+ expect(entity.is_a? Horza::Entities::Single).to be true
563
+ end
564
+ end
565
+ end
566
+
558
567
  context '#singular_entity_class' do
559
568
  context 'when singular entity class does not exist' do
560
569
  let(:dummy_model) { HorzaSpec::DummyModel.create }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: horza
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Turner