seeing_is_believing 2.1.0 → 2.1.1
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/features/regression.feature +27 -11
- data/lib/seeing_is_believing/binary.rb +7 -0
- data/lib/seeing_is_believing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e594958816257fbb764c069509cd2a40f28f7f8f
|
4
|
+
data.tar.gz: c1db0bd98d9631d141d2dc945a4a29c5b2c9cc39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 308b4699bfeb499c84570010ee07deefcf1e548040ebdde5e9773f1cc17c48a6a000a4179dabadc18af322b31ced6ec020d4406af4a405823a9ea3f7d825af4e
|
7
|
+
data.tar.gz: 22e0a73e67ef4e11604d1207d1570a24319f755ff6411a5dd9e398336d75f7a532eb6613975342ebcbd329be0df1ec3f2427dc4f396c9bee5ade74177515c21b
|
data/features/regression.feature
CHANGED
@@ -84,17 +84,6 @@ Feature:
|
|
84
84
|
"""
|
85
85
|
|
86
86
|
|
87
|
-
# NOTE: Don't change the body of this file, it's nondeterministic
|
88
|
-
# I have no idea why this particular string fucks Parser up, but other similar ones don't
|
89
|
-
# We can probably remove this once parser reaches 2.0.0, they've fixed this bug now.
|
90
|
-
Scenario: Parser correctly identify comments
|
91
|
-
Given the file "parser_bug.rb" "Class # whatever"
|
92
|
-
When I run "seeing_is_believing parser_bug.rb"
|
93
|
-
Then stdout is "Class # whatever"
|
94
|
-
Then stderr is empty
|
95
|
-
And the exit status is 0
|
96
|
-
|
97
|
-
|
98
87
|
Scenario: Modifying output doesn't fuck it up when passing it back again as input
|
99
88
|
Given the file "modified_result.rb":
|
100
89
|
"""
|
@@ -271,3 +260,30 @@ Feature:
|
|
271
260
|
|
272
261
|
# >> omg
|
273
262
|
"""
|
263
|
+
|
264
|
+
Scenario: Long DATA segment in a valid file
|
265
|
+
Given the file "long_valid_data_segment.rb":
|
266
|
+
"""
|
267
|
+
__END__
|
268
|
+
{{'.' * 100_000}}
|
269
|
+
"""
|
270
|
+
When I run "seeing_is_believing long_valid_data_segment.rb"
|
271
|
+
Then stderr is empty
|
272
|
+
Then stdout is:
|
273
|
+
"""
|
274
|
+
__END__
|
275
|
+
{{'.' * 100_000}}
|
276
|
+
"""
|
277
|
+
|
278
|
+
|
279
|
+
Scenario: Long DATA segment in an invalid file
|
280
|
+
Given the file "long_invalid_data_segment.rb":
|
281
|
+
"""
|
282
|
+
'
|
283
|
+
__END__
|
284
|
+
{{'.' * 100_000}}
|
285
|
+
"""
|
286
|
+
When I run "seeing_is_believing long_invalid_data_segment.rb"
|
287
|
+
Then stderr includes "1: unterminated string meets end of file"
|
288
|
+
And the exit status is 2
|
289
|
+
And stdout is empty
|
@@ -166,6 +166,13 @@ class SeeingIsBelieving
|
|
166
166
|
@error_notice = begin
|
167
167
|
out, err, syntax_status = Open3.capture3 flags[:shebang], '-c', stdin_data: body
|
168
168
|
err unless syntax_status.success?
|
169
|
+
|
170
|
+
# The stdin_data may still be getting written when the pipe closes
|
171
|
+
# This is because Ruby will stop reading from stdin if everything left is in the DATA segment, and the data segment is not referenced.
|
172
|
+
# In this case, the Syntax is fine
|
173
|
+
# https://bugs.ruby-lang.org/issues/9583
|
174
|
+
rescue Errno::EPIPE
|
175
|
+
nil
|
169
176
|
end
|
170
177
|
end
|
171
178
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seeing_is_believing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Cheek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|