Skip to content

Commit

Permalink
Add CI support for ruby 3 and fix broken spec
Browse files Browse the repository at this point in the history
Spec started failing because a statement which we expected to be a
syntax error is now interpreted as a valid pattern-matching statement.
Swapping the hash-rockets for colons turns this back into a syntax
error.
  • Loading branch information
bingram-eab committed Jan 3, 2021
1 parent 7fb884f commit 25f5022
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ jobs:
- <<: *bundle_install
- <<: *install_ubuntu_nano
- <<: *unit
"ruby-3.0":
docker:
- image: circleci/ruby:3.0
working_directory: ~/pry
steps:
- <<: *repo_restore_cache
- <<: *bundle_install
- <<: *install_ubuntu_nano
- <<: *unit
"jruby-9.1-jdk":
docker:
- image: circleci/jruby:9.1-jdk
Expand Down Expand Up @@ -199,6 +208,10 @@ workflows:
requires:
- rubocop_lint
- yard_lint
- "ruby-3.0":
requires:
- rubocop_lint
- yard_lint
- "jruby-9.1-jdk":
requires:
- rubocop_lint
Expand Down
2 changes: 1 addition & 1 deletion spec/syntax_checking_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
["o = Object.new.tap{ def o.render;", "'MEH'", "}"],

# multiple syntax errors reported in one SyntaxException
["puts {'key'=>'val'}.to_json"]
["puts {key: 'val'}.to_json"]
].compact.each do |foo|
it "should raise an error on invalid syntax like #{foo.inspect}" do
redirect_pry_io(InputTester.new(*foo), @str_output) do
Expand Down

0 comments on commit 25f5022

Please sign in to comment.