pebbles-river 0.0.6 → 0.0.7
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.
- data/lib/pebbles/river/message.rb +3 -1
- data/lib/pebbles/river/version.rb +1 -1
- data/spec/lib/worker_spec.rb +32 -11
- metadata +2 -2
| @@ -53,7 +53,9 @@ module Pebbles | |
| 53 53 | 
             
                  end
         | 
| 54 54 |  | 
| 55 55 | 
             
                  def nack
         | 
| 56 | 
            -
                     | 
| 56 | 
            +
                    # TODO: This requires Bunny 0.9+. We therefore don't nack at all, but
         | 
| 57 | 
            +
                    #   let messages simply expire, since pre-0.9 doesn't have a way to nack.
         | 
| 58 | 
            +
                    #@channel.nack(delivery_tag, false)
         | 
| 57 59 | 
             
                  end
         | 
| 58 60 |  | 
| 59 61 | 
             
                end
         | 
    
        data/spec/lib/worker_spec.rb
    CHANGED
    
    | @@ -152,15 +152,27 @@ describe Worker do | |
| 152 152 | 
             
                end
         | 
| 153 153 |  | 
| 154 154 | 
             
                context 'when handler returns false' do
         | 
| 155 | 
            -
                   | 
| 156 | 
            -
                     | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 155 | 
            +
                  if false  # Needs Bunny 0.9+
         | 
| 156 | 
            +
                    it 'nacks the message' do
         | 
| 157 | 
            +
                      expect(queue).to receive(:nack).at_least(1).times
         | 
| 158 | 
            +
                      expect(queue).to_not receive(:ack)
         | 
| 159 | 
            +
                      expect(queue).to_not receive(:close)
         | 
| 159 160 |  | 
| 160 | 
            -
             | 
| 161 | 
            -
             | 
| 161 | 
            +
                      expect(river).to receive(:connected?).with(no_args).at_least(1).times
         | 
| 162 | 
            +
                      expect(river).to_not receive(:connect)
         | 
| 163 | 
            +
             | 
| 164 | 
            +
                      subject.new(false_handler, queue: {name: 'foo'}).run_once
         | 
| 165 | 
            +
                    end
         | 
| 166 | 
            +
                  else
         | 
| 167 | 
            +
                    it 'leaves the message un-acked' do
         | 
| 168 | 
            +
                      expect(queue).to_not receive(:ack)
         | 
| 169 | 
            +
                      expect(queue).to_not receive(:close)
         | 
| 162 170 |  | 
| 163 | 
            -
             | 
| 171 | 
            +
                      expect(river).to receive(:connected?).with(no_args).at_least(1).times
         | 
| 172 | 
            +
                      expect(river).to_not receive(:connect)
         | 
| 173 | 
            +
             | 
| 174 | 
            +
                      subject.new(false_handler, queue: {name: 'foo'}).run_once
         | 
| 175 | 
            +
                    end
         | 
| 164 176 | 
             
                  end
         | 
| 165 177 | 
             
                end
         | 
| 166 178 |  | 
| @@ -172,11 +184,20 @@ describe Worker do | |
| 172 184 | 
             
                    on_exception_callback
         | 
| 173 185 | 
             
                  end
         | 
| 174 186 |  | 
| 175 | 
            -
                   | 
| 176 | 
            -
                     | 
| 177 | 
            -
             | 
| 187 | 
            +
                  if false  # Needs Bunny 0.9+
         | 
| 188 | 
            +
                    it 'nacks the message' do
         | 
| 189 | 
            +
                      expect(queue).to receive(:nack).at_least(1).times
         | 
| 190 | 
            +
                      expect(queue).to_not receive(:close)
         | 
| 178 191 |  | 
| 179 | 
            -
             | 
| 192 | 
            +
                      subject.new(io_error_raising_handler, queue: {name: 'foo'}).run_once
         | 
| 193 | 
            +
                    end
         | 
| 194 | 
            +
                  else
         | 
| 195 | 
            +
                    it 'leaves the message un-acked' do
         | 
| 196 | 
            +
                      expect(queue).to_not receive(:ack)
         | 
| 197 | 
            +
                      expect(queue).to_not receive(:close)
         | 
| 198 | 
            +
             | 
| 199 | 
            +
                      subject.new(io_error_raising_handler, queue: {name: 'foo'}).run_once
         | 
| 200 | 
            +
                    end
         | 
| 180 201 | 
             
                  end
         | 
| 181 202 |  | 
| 182 203 | 
             
                  [
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: pebbles-river
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.7
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2014- | 
| 13 | 
            +
            date: 2014-06-11 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: pebblebed
         |