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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abbcb4fd5db54b1a8b6158b07cb9b4705a1d7bc5
4
- data.tar.gz: 1201fcec0c2768dae5769a6aca6aa06463992a27
3
+ metadata.gz: e594958816257fbb764c069509cd2a40f28f7f8f
4
+ data.tar.gz: c1db0bd98d9631d141d2dc945a4a29c5b2c9cc39
5
5
  SHA512:
6
- metadata.gz: 63eb02d6a89e340a6f29cb1a49ed31d7ab5153550be46bba89309b193154faab7894dca268bbb9f367be8d3a0ba713d4b30d94a71b70fef7e7bc51e63498c001
7
- data.tar.gz: 98fefbaaef519b2e61489c47ce7b9b0425572bd326d9a2d93e6b36b2e1f73349d52fa91f454b15775356d66e615faf32678523664ea31a65e41188114eb862f1
6
+ metadata.gz: 308b4699bfeb499c84570010ee07deefcf1e548040ebdde5e9773f1cc17c48a6a000a4179dabadc18af322b31ced6ec020d4406af4a405823a9ea3f7d825af4e
7
+ data.tar.gz: 22e0a73e67ef4e11604d1207d1570a24319f755ff6411a5dd9e398336d75f7a532eb6613975342ebcbd329be0df1ec3f2427dc4f396c9bee5ade74177515c21b
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  class SeeingIsBelieving
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
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.0
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-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser