arrow_test 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9dc2c7bd783942d320008871b857de3d24b41ec
4
- data.tar.gz: 20df041838b7cf521806cab06c6688215fe4b2ef
3
+ metadata.gz: 3ccb0ca96be5f268c6e63cdbcd2bc2db0b0ed5d4
4
+ data.tar.gz: ae851836b0eae480bcb3c624f469c43a9116496a
5
5
  SHA512:
6
- metadata.gz: e38b81c3d4c2af439c478f9ac502ec1dee825b7adb128af2618c3a76b6007eef0b17f69112990770b00e1fcd3bfe80332171454a4906286f98d3549231ed81c5
7
- data.tar.gz: 211b931a619903f49bc39438bfb2700721a5997e15f6dc39fb7f417e482029d4b603d0e1944da66ffe91377d8cd0cc4f9a4a219f091498a09a20c67502b31619
6
+ metadata.gz: 9346d3466f43cb7e2a84cd98339d69b0aaf9f906814c63a66c6a3e87a548c4fbd00151a6b87fea7a0ecbce23d64d83f824c1abd2cabfebb13dcf230fbd4ddaf2
7
+ data.tar.gz: 14dcb646625c0f6b425def340ec5454e352c00d4318fabfde54cc19a158dec1659a9c36c6fb59e96d8193325b32613eee4222dfc08dcfd131245e580aa654a8d
data/lib/arrow_test.rb CHANGED
@@ -13,6 +13,7 @@ def helper_arrow_test(lines, verbose=false)
13
13
  thick_arrow_regex = Regexp.new('\ *\#\ *\=\ *\>\ *')
14
14
  lines
15
15
  .select{|line| arrow_regex.match(line) || thick_arrow_regex.match(line)}
16
+ .map {|line| line[0] == '#' ? line[1...line.length] : line}
16
17
  .each do |line|
17
18
  expression = line.split('#').first.strip
18
19
  result = line.split('#').last.sub("\n", '').sub("-",'').sub(">",'').sub('=','').strip
@@ -51,10 +52,3 @@ def arrow_test(filename=$0, verbose=false)
51
52
  puts helper_arrow_test(IO.foreach(filename).to_a, verbose)
52
53
  end
53
54
 
54
- if __FILE__ == $0
55
- 1 #-> 1
56
- 1 + 1 #-> 3
57
- "hello".reverse #-> "oleh"
58
-
59
- arrow_test($0, true)
60
- end
data/test_arrow_test.rb CHANGED
@@ -19,5 +19,9 @@ class ArrowTestTest < Test::Unit::TestCase
19
19
  def test_thick_line_with_spaces
20
20
  assert(helper_arrow_test(['1 # => 1']) == [], 'Thick line also works.')
21
21
  end
22
+
23
+ def test_beggining_comment
24
+ assert(helper_arrow_test(['# 1+1 #-> 2']) == [], 'Begging comment is removed')
25
+ end
22
26
  end
23
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arrow_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caridorc Tergilti