You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/bundler/commands/console_spec.rb
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ def __pry__
35
35
end
36
36
RUBY
37
37
end
38
+
39
+
build_dummy_irb
38
40
end
39
41
end
40
42
@@ -46,7 +48,8 @@ def __pry__
46
48
end
47
49
48
50
install_gemfile<<-G
49
-
source "https://gem.repo1"
51
+
source "https://gem.repo2"
52
+
gem "irb"
50
53
path "#{lib_path}" do
51
54
gem "loadfuuu", require: true
52
55
end
@@ -66,6 +69,7 @@ def __pry__
66
69
beforedo
67
70
install_gemfile<<-G
68
71
source "https://gem.repo2"
72
+
gem "irb"
69
73
gem "myrack"
70
74
gem "activesupport", :group => :test
71
75
gem "myrack_middleware", :group => :development
@@ -81,16 +85,19 @@ def __pry__
81
85
end
82
86
83
87
it"uses IRB as default console"do
88
+
skip"Does not work in a ruby-core context if irb is in the default $LOAD_PATH because it enables the real IRB, not our dummy one"ifruby_core? && Gem.ruby_version < Gem::Version.new("3.5.0.a")
89
+
84
90
bundle"console"do |input,_,_|
85
-
input.puts("__FILE__")
91
+
input.puts("__method__")
86
92
input.puts("exit")
87
93
end
88
-
expect(out).toinclude("(irb)")
94
+
expect(out).toinclude("__irb__")
89
95
end
90
96
91
97
it"starts another REPL if configured as such"do
92
98
install_gemfile<<-G
93
99
source "https://gem.repo2"
100
+
gem "irb"
94
101
gem "pry"
95
102
G
96
103
bundle"config set console pry"
@@ -103,14 +110,16 @@ def __pry__
103
110
end
104
111
105
112
it"falls back to IRB if the other REPL isn't available"do
113
+
skip"Does not work in a ruby-core context if irb is in the default $LOAD_PATH because it enables the real IRB, not our dummy one"ifruby_core? && Gem.ruby_version < Gem::Version.new("3.5.0.a")
114
+
106
115
bundle"config set console pry"
107
116
# make sure pry isn't there
108
117
109
118
bundle"console"do |input,_,_|
110
-
input.puts("__FILE__")
119
+
input.puts("__method__")
111
120
input.puts("exit")
112
121
end
113
-
expect(out).toinclude("(irb)")
122
+
expect(out).toinclude("__irb__")
114
123
end
115
124
116
125
it"does not try IRB twice if no console is configured and IRB is not available"do
0 commit comments