doc_rspec 0.2.4 → 0.2.5
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/doc_rspec/parser.rb +3 -1
- data/lib/doc_rspec/version.rb +1 -1
- data/lib/doc_rspec.rb +9 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e2ea270de14b4a37fd648bde29d59a4f0a2244159d22a06e798c2387faa96f8
|
4
|
+
data.tar.gz: b3588a664c869b921e789c778be7508f8189628281d2c65796be3c3b31c1d060
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90a3129c0e172feaaae26d3d15cee20df6199d43d9d76676eab7b579038fbbd97c5f129fd4e72ac3ece19be2a4a01b260b60e255d765aa5f5b60478808ef2bfa
|
7
|
+
data.tar.gz: 31d6850d1534204007cf3953800c9d5a9f1cdf4e2f7e4450e93ca4dbfa44af7ea76fd8bf2e1fc03697f50a248c21eefe1f5d3d2693f76c30b9f564d18cbd59cc
|
data/lib/doc_rspec/parser.rb
CHANGED
@@ -13,7 +13,7 @@ class DocRSpec
|
|
13
13
|
CONTEXT_DEFINITION = %r{\A \s* \# \s ={1,7} \s (.*)}x
|
14
14
|
|
15
15
|
EXAMPLE_LINE = %r{\A \s* \# \s{4,} (.*)}x
|
16
|
-
|
16
|
+
|
17
17
|
SHORT_EQUALS = %r{\s \=\=\> \s}x
|
18
18
|
SHORT_MATCHES = %r{\s \~\> \s}x
|
19
19
|
SHORT_PREDICATE = %r{\s is\! \s}x
|
@@ -62,6 +62,8 @@ class DocRSpec
|
|
62
62
|
code = match[1]
|
63
63
|
return if code.empty?
|
64
64
|
|
65
|
+
return if COMMENT_LINE === code
|
66
|
+
|
65
67
|
compiled =
|
66
68
|
SHORTCUTS.find_value(default: code) do |shtct_def|
|
67
69
|
shtct_def => [rgx, to_or_not, rhs_template]
|
data/lib/doc_rspec/version.rb
CHANGED
data/lib/doc_rspec.rb
CHANGED
@@ -93,6 +93,15 @@ RSpec.configure { it.extend DocRSpec::RSpecExampleGroup }
|
|
93
93
|
# require 'ostruct'
|
94
94
|
# OpenStruct.new(ok?: false) not! ok
|
95
95
|
#
|
96
|
+
#
|
97
|
+
# === Comments inside examples
|
98
|
+
#
|
99
|
+
# # example: comments are removed
|
100
|
+
#
|
101
|
+
# # so this works
|
102
|
+
# expect(1).to eq(1)
|
103
|
+
# # and this ==> too
|
104
|
+
#
|
96
105
|
# === End of Example
|
97
106
|
#
|
98
107
|
# the code does not continue after the rdoc comment
|