From 846b7ecb6f804d4192cc44a673c2a85b73f1f0b7 Mon Sep 17 00:00:00 2001 From: Josh Cheek Date: Thu, 11 Jul 2019 08:54:10 -0500 Subject: Attempt to allow pasting multiple lines with leading dots (#2060) Two tests are breaking, and I kind of understand why, but I'm not sure what to do about it. Figured I should commit and send a PR in hopes of another brain being able to help me out :) --- spec/command_integration_spec.rb | 4 ++-- spec/command_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'spec') diff --git a/spec/command_integration_spec.rb b/spec/command_integration_spec.rb index 7579da62..cca00136 100644 --- a/spec/command_integration_spec.rb +++ b/spec/command_integration_spec.rb @@ -456,7 +456,7 @@ describe "commands" do end end - expect(pry_tester(commands: klass).eval("def yo\nhello\n")).to eq 7 + expect(pry_tester(commands: klass).eval("def yo", "hello")).to eq 7 end it( @@ -469,7 +469,7 @@ describe "commands" do end end - expect(pry_tester(commands: klass).eval("def yo\nhello\n")).to eq 5 + expect(pry_tester(commands: klass).eval("def yo", "hello\n")).to eq 5 end it 'should set the commands default, and the default should be overridable' do diff --git a/spec/command_spec.rb b/spec/command_spec.rb index b676be81..d56bc09a 100644 --- a/spec/command_spec.rb +++ b/spec/command_spec.rb @@ -342,7 +342,7 @@ RSpec.describe Pry::Command do before { subject.command_options(use_prefix: true) } it "returns a Regexp without a prefix" do - expect(subject.command_regex).to eq(/^test\-command(?!\S)/) + expect(subject.command_regex).to eq(/\Atest\-command(?!\S)/) end end @@ -350,7 +350,7 @@ RSpec.describe Pry::Command do before { subject.command_options(use_prefix: false) } it "returns a Regexp with a prefix" do - expect(subject.command_regex).to eq(/^(?:)?test\-command(?!\S)/) + expect(subject.command_regex).to eq(/\A(?:)?test\-command(?!\S)/) end end end -- cgit v1.2.1