atp 0.3.1 → 0.3.2

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: 1cae637faa5b243ed37ff8255c7964bc7a02d82a
4
- data.tar.gz: 8144fe3263ea7b626c7097156a9014783ceecac3
3
+ metadata.gz: de3a4282f251dd1dca4bbc42c90514646b390ecb
4
+ data.tar.gz: 7b7adde092bf2c0c24b6908808de1bdfa64600fe
5
5
  SHA512:
6
- metadata.gz: 40be54c02cb2b5359587c251ca16efe61fc33b79cf58465919af30aa871fff53f012c801a0317505e35bebdda18cce45b5f2382c272a9826024eb3cbc7e68524
7
- data.tar.gz: 60cede7df8662ae64bcff7c46458ab9326b9e500caf2f496fd2ab15bdc79c41ce5ea2f78fe8c89e7b8ac1ea30116d2dcf8def6bc45354a4a60c7e6969955d22f
6
+ metadata.gz: 754e3251438749ead9645225e612753284f77dec2e468e376d2c6dba8be75e9b5f9a6374a801b7032bb0af0f0a6b6969f44a0725e6c55172f8f0a8534f4c8b42
7
+ data.tar.gz: cad825d6fe405ff8cfa77d941a8acec72822a99b4325df4c1bb9449b334adcb8980e93bf1ef8e048b44a80c1539eb4759d00c379ddceaaeb9a5d346e84d41abc
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module ATP
2
2
  MAJOR = 0
3
3
  MINOR = 3
4
- BUGFIX = 1
4
+ BUGFIX = 2
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -6,6 +6,10 @@ module ATP
6
6
  attr_reader :context
7
7
  attr_accessor :source_file, :source_line_number, :description
8
8
 
9
+ def initialize
10
+ @context = { conditions: [] }
11
+ end
12
+
9
13
  def flow
10
14
  n0(:flow)
11
15
  end
data/lib/atp/flow.rb CHANGED
@@ -157,21 +157,19 @@ module ATP
157
157
  # Returns true if the test context generated from the supplied options + existing condition
158
158
  # wrappers, is different from that which was applied to the previous test.
159
159
  def context_changed?(options)
160
- a = context[:conditions]
161
- b = build_context(options)[:conditions]
162
- !conditions_equal?(a, b)
160
+ a = context
161
+ b = build_context(options)
162
+ !context_equal?(a, b)
163
163
  end
164
164
 
165
165
  def context
166
166
  builder.context
167
167
  end
168
168
 
169
- private
170
-
171
- def conditions_equal?(a, b)
169
+ def context_equal?(a, b)
172
170
  if a.size == b.size
173
- a = clean_condition(a)
174
- b = clean_condition(b)
171
+ a = clean_condition(a[:conditions])
172
+ b = clean_condition(b[:conditions])
175
173
  if a.keys.sort == b.keys.sort
176
174
  a.all? do |key, value|
177
175
  value.flatten.uniq.sort == b[key].flatten.uniq.sort
@@ -180,6 +178,8 @@ module ATP
180
178
  end
181
179
  end
182
180
 
181
+ private
182
+
183
183
  def clean_condition(h)
184
184
  c = {}
185
185
  h.each do |hash|
@@ -10,15 +10,27 @@ module ATP
10
10
  end
11
11
 
12
12
  def on_id(node)
13
- node.updated(nil, ["#{node.value}_#{id}"])
13
+ if node.value =~ /^extern/
14
+ node
15
+ else
16
+ node.updated(nil, ["#{node.value}_#{id}"])
17
+ end
14
18
  end
15
19
 
16
20
  def on_test_result(node)
17
21
  tid, state, nodes = *node
18
22
  if tid.is_a?(Array)
19
- tid = tid.map { |tid| "#{tid}_#{id}" }
23
+ tid = tid.map do |tid|
24
+ if tid =~ /^extern/
25
+ tid
26
+ else
27
+ "#{tid}_#{id}"
28
+ end
29
+ end
20
30
  else
21
- tid = "#{tid}_#{id}"
31
+ if tid !~ /^extern/
32
+ tid = "#{tid}_#{id}"
33
+ end
22
34
  end
23
35
  node.updated(nil, [tid, state] + [process(nodes)])
24
36
  end
@@ -40,11 +40,13 @@ module ATP
40
40
  def on_test_executed(node)
41
41
  ids = node.to_a[0]
42
42
  [ids].flatten.each do |id|
43
- @referenced_ids[id] ||= []
44
- @referenced_ids[id] << node
45
- unless @present_ids[id]
46
- @referenced_early[id] ||= []
47
- @referenced_early[id] << node
43
+ unless id =~ /^extern/
44
+ @referenced_ids[id] ||= []
45
+ @referenced_ids[id] << node
46
+ unless @present_ids[id]
47
+ @referenced_early[id] ||= []
48
+ @referenced_early[id] << node
49
+ end
48
50
  end
49
51
  end
50
52
  process_all(node)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-05 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen