summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2019-05-08 00:13:29 +0300
committerKyrylo Silin <silin@kyrylo.org>2019-05-08 00:14:20 +0300
commitcd1a9bbe5eaac5d4a08c76e34605309d5d9e7bcb (patch)
treeff86fbe6ea03a92ae426d168538409833ec241fd /spec/commands
parent18c45d26c55a659461c13a5f423f1a5094a74571 (diff)
downloadpry-cd1a9bbe5eaac5d4a08c76e34605309d5d9e7bcb.tar.gz
Fix offences of the Style/FrozenStringLiteralComment cop
Fixes #1824 (Enabling `# frozen_string_literal: true` in `~/.pryc` crashes most operations)
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/play_spec.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/spec/commands/play_spec.rb b/spec/commands/play_spec.rb
index 000f6fe5..04573eb9 100644
--- a/spec/commands/play_spec.rb
+++ b/spec/commands/play_spec.rb
@@ -37,6 +37,7 @@ describe "play" do
it 'should play a file' do
@t.process_command 'play spec/fixtures/whereami_helper.rb'
expect(@t.eval_string).to eq unindent(<<-STR)
+ # frozen_string_literal: true
# rubocop:disable Layout/EmptyLineBetweenDefs
class Cor
def a; end
@@ -50,16 +51,18 @@ describe "play" do
it 'should output file contents with print option' do
@t.process_command 'play --print spec/fixtures/whereami_helper.rb'
- expect(@t.last_output).to eq unindent(<<-STR)
- 1: # rubocop:disable Layout/EmptyLineBetweenDefs
- 2: class Cor
- 3: def a; end
- 4: def b; end
- 5: def c; end
- 6: def d; end
- 7: end
- 8: # rubocop:enable Layout/EmptyLineBetweenDefs
- STR
+ expect(@t.last_output).to eq(
+ " 1: \# frozen_string_literal: true\n" \
+ " 2: \n" \
+ " 3: \# rubocop:disable Layout/EmptyLineBetweenDefs\n" \
+ " 4: class Cor\n" \
+ " 5: def a; end\n" \
+ " 6: def b; end\n" \
+ " 7: def c; end\n" \
+ " 8: def d; end\n" \
+ " 9: end\n" \
+ "10: \# rubocop:enable Layout/EmptyLineBetweenDefs\n"
+ )
end
end