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 +4 -4
- data/lib/arrow_test.rb +1 -7
- data/test_arrow_test.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ccb0ca96be5f268c6e63cdbcd2bc2db0b0ed5d4
|
|
4
|
+
data.tar.gz: ae851836b0eae480bcb3c624f469c43a9116496a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|