test_bench-fixture 1.2.2.0 → 1.2.2.1

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
  SHA256:
3
- metadata.gz: 92b0873c28e3a281b549ddd3d9247c521aa10156b478871c02222294d5cf3adc
4
- data.tar.gz: ea44fe5f2acd028bf0401975fc77e82e8ff698c657a86009f661d093d8649f6a
3
+ metadata.gz: 4555b782d4916254da1a5cad74ae69b8bc10072f45fa89f0527ddba0a581cb2d
4
+ data.tar.gz: 608f1985785f4664727093f86958ba3dff3ed0ead19234a473339f7dced32b78
5
5
  SHA512:
6
- metadata.gz: d1ce9862fcf53f463caf27576548393cae6691bc51632a990727dada4c3e7258b5692671f6765db71b015771f06bfe6ff5bf6c73089fe555bfef8d737921d3b5
7
- data.tar.gz: fda6888b01d652073e9d739078d00677d9abc561607864eba80cc9bbd70a438e66bcf15918af48b8c5a50e40324e110b183ac48c760d5f1978cac8dbc53a317a
6
+ metadata.gz: 46b499e82c1fe3a8a4c5648c013a71d96fe4273734771f5d29ec092969faf051a618c221389f61ceed0500274d4490113d96351106c09ec5916378a07cb9cba7
7
+ data.tar.gz: 26db4c70d4fa210b84ee592e1b8849a9b2622f7a56096844dfd5c85e77c035607cd481bdce1ac0072aaa59652bd4312d7ef3cff83e52ac97db35f20f13e943f0
@@ -99,13 +99,31 @@ module TestBench
99
99
  def new_record(signal, data)
100
100
  context = current_context.dup
101
101
 
102
- record = Record.new(signal, data, context)
102
+ record = Record.build(signal, data, context)
103
103
  end
104
104
 
105
- Record = Struct.new(:signal, :data, :context) do
105
+ class Record
106
+ attr_accessor :signal
107
+ attr_accessor :data
108
+ attr_accessor :context
109
+
110
+ def self.build(signal, data, context=nil)
111
+ instance = new
112
+ instance.signal = signal
113
+ instance.data = data
114
+ instance.context = context
115
+ instance
116
+ end
117
+
106
118
  def forward(receiver)
107
119
  receiver.public_send(signal, *data)
108
120
  end
121
+
122
+ def ==(record)
123
+ self.signal == record.signal &&
124
+ self.data == record.data &&
125
+ self.context == record.context
126
+ end
109
127
  end
110
128
  end
111
129
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_bench-fixture
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2.0
4
+ version: 1.2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-31 00:00:00.000000000 Z
11
+ date: 2020-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test_bench-bootstrap