arrow_test 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/arrow_test.rb +20 -0
  3. metadata +3 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab80fb2ab081c38e14d753204fe4fc886959df00
4
- data.tar.gz: 0fec4258fb1605fdf9f1b3b7c9150b3fbfe9540c
3
+ metadata.gz: 6b46b6c8dbd1a5aa735ffdcdd3b53255802deef8
4
+ data.tar.gz: f3c846eb3cd86cc947d28e1ae927599b7fa7071e
5
5
  SHA512:
6
- metadata.gz: a542a1596a9d11dedd585bd572b63f9dd4698c0291c5f4b985f88d49fa6505872bb0b40cdbc1338c462ea78b5a0a9e8262b64c84c6a2e677da4a0241ff96a3db
7
- data.tar.gz: d07eef93af3f466c51e03b2fda5360096fb0693b37035de6af23cbf6f1717aa17ecef515eee6636ec8a461bba82adbd30da65f5da6754e4153c455ccd4b24eed
6
+ metadata.gz: 2dfeaf8256e946431251e03e5a1f92a6f235811338fba09d104d1e0dc71a25e44a10b4ee48d7f5abb393b5476ddb680cbaf832f7a32218042997a243dd1881cb
7
+ data.tar.gz: 9d4a393b4fe64a4b0587f8ba0fe930128bfca3382957885207224355ab07a31727d25fa4f58139e550e30a63478f1275c7f173787efd8891c51134bb8b1b4d8c
data/lib/arrow_test.rb CHANGED
@@ -1,5 +1,14 @@
1
1
  require 'colorize'
2
2
 
3
+ # Performs the logic of the arrow test.
4
+ #
5
+ # Example:
6
+ # >> helper_arrow_test(["", "1+1 #-> 3"])
7
+ # => ["ERROR:\n EXECUTING: 1 + 1\n EXPECTED: 3\n INSTEAD GOT: 2\n\n\n"]
8
+ #
9
+ # Arguments:
10
+ # lines: (String) The lines of code to be arrow tested.
11
+ # verbose: (Boolean) If true returns also correct tests.
3
12
  def helper_arrow_test(lines, verbose=false)
4
13
  messages = []
5
14
  arrow_regex = Regexp.new('\ *\#\ *\-\ *\>\ *')
@@ -29,6 +38,17 @@ END
29
38
  messages
30
39
  end
31
40
 
41
+ # Performs Input/Output wrapping `helper_arrow_test`
42
+ # Call this in your code.
43
+ #
44
+ # Example:
45
+ # require 'arrow_testing'
46
+ # 1 + 1 # -> 3
47
+ # arrow_test
48
+ #
49
+ # Arguments:
50
+ # filename: (String) The filename to be tested. Default is $0: your current file.
51
+ # verbose: (Boolean) If true outputs also correct tests.
32
52
  def arrow_test(filename=$0, verbose=false)
33
53
  puts helper_arrow_test(IO.foreach(filename).to_a, verbose)
34
54
  end
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.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caridorc Tergilti
@@ -13,17 +13,11 @@ dependencies: []
13
13
  description: |2
14
14
  `Vigorous testing is coincise`
15
15
 
16
- This gem allows coincise testing, even shorter than docctest.
16
+ This gem allows coincise testing, even shorter than doctest.
17
17
 
18
18
  It also adds minimal overhead to your file!
19
19
 
20
- An example usage shows how little typing is required:
21
-
22
- require 'arrow_test'
23
- 1 + 1 -> 3
24
- arrow_test
25
-
26
- And you are done! Running the above will show you the error.
20
+ See the documentation for examples.
27
21
  email: riki100024@gmail.com
28
22
  executables: []
29
23
  extensions: []