atp 0.4.2 → 0.4.3

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: cc41fbbf375fb2096a5a6448cd8cbb6a17c1acec
4
- data.tar.gz: ce6ae9e83db3fb17a0e65054aa85aecaef755b47
3
+ metadata.gz: 8486776ce5c49ed49887188d3368b6b8c8b14547
4
+ data.tar.gz: e4c8f89a29f55be26629b87896a8e41d405edb92
5
5
  SHA512:
6
- metadata.gz: 920d52764ac0272df6f068412252587343194f04f3931dcdaf73c1905b78ea4d7129e27cfa4560c5017cad4a2ee5274fb021c27398d0d628eb4871a54bdfebc8
7
- data.tar.gz: 11f5b29de3140272e07a2f8bf98c548f009f980f895666664b43fcb98f9775ecfb5e81807167810d5cb2bf530fee8a67688b95c31c32310cee3bc1d3aff6f859
6
+ metadata.gz: 78b3e52cdbaccf58d4cd1e66557a8f2f093122a51d3af07212ddcc5e6d3d4a10792c98bad8bb31e7810c286654de81107ebcba5658564641fe9fdbbb18d79154
7
+ data.tar.gz: 7473fe3cc9a7d668733ab61ce33af26034bd8c51a53668ace3b246cd14c921fafd55f686a17bae370914ab586b3cdb2592341ee9c6cddabda0ee31f3fd3d579b
data/config/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module ATP
2
2
  MAJOR = 0
3
3
  MINOR = 4
4
- BUGFIX = 2
4
+ BUGFIX = 3
5
5
  DEV = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
@@ -197,12 +197,22 @@ module ATP
197
197
  def test(object, options = {})
198
198
  children = [n(:object, object)]
199
199
 
200
- if n = (options[:name] || options[:tname] || options[:test_name])
201
- children << name(n)
200
+ n = (options[:name] || options[:tname] || options[:test_name])
201
+ unless n
202
+ [:name, :tname, :test_name].each do |m|
203
+ n ||= object.respond_to?(m) ? object.send(m) : nil
204
+ end
202
205
  end
203
- if n = (options[:number] || options[:num] || options[:tnum] || options[:test_number])
204
- children << number(n)
206
+ children << name(n) if n
207
+
208
+ n = (options[:number] || options[:num] || options[:tnum] || options[:test_number])
209
+ unless n
210
+ [:number, :num, :tnum, :test_number].each do |m|
211
+ n ||= object.respond_to?(m) ? object.send(m) : nil
212
+ end
205
213
  end
214
+ children << number(n) if n
215
+
206
216
  children << id(options[:id].to_s.downcase.to_sym) if options[:id]
207
217
 
208
218
  children << on_fail(options[:on_fail]) if options[:on_fail]
@@ -8,7 +8,7 @@ module ATP
8
8
  str = 'Number'.ljust(15)
9
9
  str += 'Result'.ljust(9)
10
10
  str += 'Name'.ljust(55)
11
- str += 'Test'.ljust(55)
11
+ str += 'Pattern'.ljust(55)
12
12
  str += 'ID'
13
13
  puts str
14
14
  process_all(node.children)
@@ -27,7 +27,7 @@ module ATP
27
27
  name = node.find(:object).value['Test']
28
28
  end
29
29
  str += "#{name}".ljust(55)
30
- str += "#{node.find(:object).value['Test']}".ljust(55)
30
+ str += "#{node.find(:object).value['Pattern']}".ljust(55)
31
31
  str += "#{node.find(:id).value}"
32
32
  puts str
33
33
  end
@@ -3,12 +3,17 @@ module ATP
3
3
  # Makes the AST safe for Marshaling
4
4
  class Marshal < Processor
5
5
  def on_object(node)
6
- if node.value.is_a?(String) || node.value.is_a?(Hash)
7
- node.updated(nil, [{ 'Test' => node.value }])
8
- elsif node.value.respond_to?(:to_meta)
9
- node.updated(nil, [node.value.to_meta])
6
+ o = node.value
7
+ if o.is_a?(String)
8
+ node.updated(nil, [{ 'Test' => o }])
9
+ elsif o.is_a?(Hash)
10
+ node.updated(nil, [o])
11
+ elsif o.respond_to?(:to_meta) && o.to_meta && !o.to_meta.empty?
12
+ node.updated(nil, [o.to_meta])
10
13
  else
11
- node.updated(nil, [{ 'Test' => node.value.name }])
14
+ meta = { 'Test' => o.name }
15
+ meta['Pattern'] = o.try(:pattern)
16
+ node.updated(nil, [meta])
12
17
  end
13
18
  end
14
19
 
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.4.2
4
+ version: 0.4.3
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-08-19 00:00:00.000000000 Z
11
+ date: 2016-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen