Skip to content

Commit

Permalink
Update to work on 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshCheek committed Jan 13, 2021
1 parent bba74ad commit 0d17250
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.5', '2.6', '2.7']
ruby-version: ['2.5', '2.6', '2.7', '3.0']

steps:
- uses: actions/checkout@v2
Expand Down
26 changes: 0 additions & 26 deletions features/regression.feature
Expand Up @@ -470,32 +470,6 @@ Feature:
"""


# See this issue for the issue we're testing for: https://github.com/JoshCheek/seeing_is_believing/issues/46
# See this issue for why we turn it off on 2.4: https://github.com/flori/json/issues/309
#
# Not going to get too detailed on what it prints, b/c that message seems pretty fragile,
# but just generally that it doesn't fkn blow up
@not-2.4
@not-2.5
@not-2.6
@not-2.7
Scenario: Old JSON bug
Given the file "json_and_encodings.rb":
"""
# encoding: utf-8
require 'json'
JSON.parse JSON.dump("√")
"""
When I run "seeing_is_believing json_and_encodings.rb"
Then stderr is empty
And the exit status is 1
And stdout includes:
"""
require 'json' # => true
JSON.parse JSON.dump("√")
"""


# https://github.com/JoshCheek/seeing_is_believing/wiki/Encodings
# https://github.com/JoshCheek/seeing_is_believing/issues/109
Scenario: Assumes utf-8 for files regardless of what Ruby thinks
Expand Down
1 change: 1 addition & 0 deletions lib/seeing_is_believing/event_stream/producer.rb
Expand Up @@ -11,6 +11,7 @@ class Producer
# Guarding against hostile users (e.g. me) that do ridiculous things like blowing away these constants
old_w, $-w = $-w, nil # Ruby warns about accessing deprecated constants
Object.constants.each do |name|
next if name == :SortedSet # Removed in 3.0, but apparently the constant still exists, it just explodes if you reference it
const_set name, Object.const_get(name)
end
$-w = old_w
Expand Down

0 comments on commit 0d17250

Please sign in to comment.