File: tx_spec.rb

package info (click to toggle)
ruby-amq-protocol 2.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 520 kB
  • sloc: ruby: 5,225; python: 248; makefile: 4
file content (55 lines) | stat: -rw-r--r-- 1,403 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# encoding: binary

module AMQ
  module Protocol
    class Tx
      RSpec.describe Select do
        describe '.encode' do
          it 'encodes the parameters into a MethodFrame' do
            channel = 1
            method_frame = Select.encode(channel)
            expect(method_frame.payload).to eq("\000Z\000\n")
            expect(method_frame.channel).to eq(1)
          end
        end
      end

      # RSpec.describe SelectOk do
      #   describe '.decode' do
      #   end
      # end

      RSpec.describe Commit do
        describe '.encode' do
          it 'encodes the parameters into a MethodFrame' do
            channel = 1
            method_frame = Commit.encode(channel)
            expect(method_frame.payload).to eq("\000Z\000\024")
            expect(method_frame.channel).to eq(1)
          end
        end
      end

      # RSpec.describe CommitOk do
      #   describe '.decode' do
      #   end
      # end

      RSpec.describe Rollback do
        describe '.encode' do
          it 'encodes the parameters into a MethodFrame' do
            channel = 1
            method_frame = Rollback.encode(channel)
            expect(method_frame.payload).to eq("\000Z\000\036")
            expect(method_frame.channel).to eq(1)
          end
        end
      end

      # RSpec.describe RollbackOk do
      #   describe '.decode' do
      #   end
      # end
    end
  end
end