byebug 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ describe "Info Command" do
5
5
  include Columnize
6
6
 
7
7
  describe "Args info" do
8
- temporary_change_hash_value(Byebug::InfoCommand.settings, :width, 15)
8
+ before { Byebug::InfoCommand.settings[:width] = 15 }
9
9
 
10
10
  it "must show info about all args" do
11
11
  enter 'break 3', 'cont', 'info args'
@@ -178,15 +178,16 @@ describe "Info Command" do
178
178
  end
179
179
 
180
180
  describe "Locals info" do
181
+
181
182
  it "must show the current local variables" do
182
- temporary_change_hash_value(Byebug::InfoCommand.settings, :width, 12) do
183
- enter 'break 21', 'cont', 'info locals'
184
- debug_file 'info'
185
- check_output_includes 'a = "1111...', 'b = 2'
186
- end
183
+ Byebug::InfoCommand.settings[:width] = 12
184
+ enter 'break 21', 'cont', 'info locals'
185
+ debug_file 'info'
186
+ check_output_includes 'a = "1111...', 'b = 2'
187
187
  end
188
188
 
189
189
  it "must fail if the local variable doesn't respond to #to_s or to #inspect" do
190
+ Byebug::InfoCommand.settings[:width] = 21
190
191
  enter 'break 26', 'cont', 'info locals'
191
192
  debug_file 'info'
192
193
  check_output_includes "*Error in evaluation*"
@@ -228,9 +229,8 @@ describe "Info Command" do
228
229
  end
229
230
 
230
231
  describe "Stack info" do
231
- before do
232
- Byebug::InfoCommand.settings[:full_path] = true
233
- end
232
+ before { Byebug::InfoCommand.settings[:full_path] = true }
233
+
234
234
  it "must show stack info" do
235
235
  enter 'break 20', 'cont', 'info stack'
236
236
  debug_file 'info'
@@ -283,8 +283,9 @@ describe "Info Command" do
283
283
  end
284
284
 
285
285
  describe "Variables info" do
286
+ before { Byebug::InfoCommand.settings[:width] = 30 }
287
+
286
288
  it "must show all variables" do
287
- Byebug::InfoCommand.settings[:width] = 30
288
289
  enter 'break 21', 'cont', 'info variables'
289
290
  debug_file 'info'
290
291
  check_output_includes 'a = "1111111111111111111111...',
@@ -4,14 +4,12 @@ describe "List Command" do
4
4
  include TestDsl
5
5
 
6
6
  describe "List Command Setup" do
7
- before do
8
- LineCache.clear_file_cache
9
- Byebug::Command.settings[:listsize] = 3
10
- end
11
-
7
+ before { LineCache.clear_file_cache }
12
8
  after { LineCache.clear_file_cache }
13
9
 
14
10
  describe "listsize" do
11
+ before { Byebug::Command.settings[:listsize] = 3 }
12
+
15
13
  it "must show lines according to :listsize setting" do
16
14
  enter 'set listsize 4', 'break 5', 'cont', 'list'
17
15
  debug_file 'list'
@@ -26,72 +24,96 @@ describe "List Command" do
26
24
  end
27
25
 
28
26
  describe "without arguments" do
27
+ before { Byebug::Command.settings[:listsize] = 3 }
28
+
29
29
  it "must show surrounding lines with the first call" do
30
30
  enter 'break 5', 'cont', 'list'
31
31
  debug_file 'list'
32
- check_output_includes "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
32
+ check_output_includes \
33
+ "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
33
34
  end
34
35
 
35
36
  it "must list forward after second call" do
36
37
  enter 'break 5', 'cont', 'list', 'list'
37
38
  debug_file 'list'
38
- check_output_includes "[7, 9] in #{fullpath('list')}", "7 7", "8 8", "9 9"
39
+ check_output_includes \
40
+ "[7, 9] in #{fullpath('list')}", "7 7", "8 8", "9 9"
39
41
  end
40
42
  end
41
43
 
42
44
  describe "list backward" do
45
+ before { Byebug::Command.settings[:listsize] = 3 }
46
+
43
47
  it "must show surrounding lines with the first call" do
44
48
  enter 'break 5', 'cont', 'list -'
45
49
  debug_file 'list'
46
- check_output_includes "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
50
+ check_output_includes \
51
+ "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
47
52
  end
48
53
 
49
54
  it "must list backward after second call" do
50
55
  enter 'break 5', 'cont', 'list -', 'list -'
51
56
  debug_file 'list'
52
- check_output_includes "[1, 3] in #{fullpath('list')}", "1 byebug", "2 2", "3 3"
57
+ check_output_includes \
58
+ "[1, 3] in #{fullpath('list')}", "1 byebug", "2 2", "3 3"
53
59
  end
54
60
  end
55
61
 
56
- it "must show the surrounding lines with =" do
57
- enter 'break 5', 'cont', 'list ='
58
- debug_file 'list'
59
- check_output_includes "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
62
+
63
+ describe "list surrounding" do
64
+ before { Byebug::Command.settings[:listsize] = 3 }
65
+
66
+ it "must show the surrounding lines with =" do
67
+ enter 'break 5', 'cont', 'list ='
68
+ debug_file 'list'
69
+ check_output_includes \
70
+ "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
71
+ end
60
72
  end
61
73
 
62
74
  describe "autolist" do
63
- temporary_change_hash_value(Byebug::Command.settings, :autolist, 0)
75
+ before do
76
+ Byebug::Command.settings[:listsize] = 3
77
+ Byebug::Command.settings[:autolist] = 0
78
+ end
64
79
 
65
80
  it "must show the surronding lines even without 'list' command if autolist is enabled" do
66
81
  enter 'set autolist', 'break 5', 'cont'
67
82
  debug_file 'list'
68
- check_output_includes "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
83
+ check_output_includes \
84
+ "[4, 6] in #{fullpath('list')}", "4 4", "=> 5 5", "6 6"
69
85
  end
70
86
  end
71
87
 
72
88
  describe "specified lines" do
89
+ before { Byebug::Command.settings[:listsize] = 3 }
90
+
73
91
  it "must show with mm-nn" do
74
92
  enter 'list 4-6'
75
93
  debug_file 'list'
76
- check_output_includes "[4, 6] in #{fullpath('list')}", "4 4", "5 5", "6 6"
94
+ check_output_includes \
95
+ "[4, 6] in #{fullpath('list')}", "4 4", "5 5", "6 6"
77
96
  end
78
97
 
79
98
  it "must show with mm,nn" do
80
99
  enter 'list 4,6'
81
100
  debug_file 'list'
82
- check_output_includes "[4, 6] in #{fullpath('list')}", "4 4", "5 5", "6 6"
101
+ check_output_includes \
102
+ "[4, 6] in #{fullpath('list')}", "4 4", "5 5", "6 6"
83
103
  end
84
104
 
85
105
  it "must show surroundings with mm-" do
86
106
  enter 'list 4-'
87
107
  debug_file 'list'
88
- check_output_includes "[3, 5] in #{fullpath('list')}", "3 3", "4 4", "5 5"
108
+ check_output_includes \
109
+ "[3, 5] in #{fullpath('list')}", "3 3", "4 4", "5 5"
89
110
  end
90
111
 
91
112
  it "must show surroundings with mm," do
92
113
  enter 'list 4,'
93
114
  debug_file 'list'
94
- check_output_includes "[3, 5] in #{fullpath('list')}", "3 3", "4 4", "5 5"
115
+ check_output_includes \
116
+ "[3, 5] in #{fullpath('list')}", "3 3", "4 4", "5 5"
95
117
  end
96
118
 
97
119
  it "must show nothing if there is no such lines" do
@@ -111,9 +133,9 @@ describe "List Command" do
111
133
  end
112
134
 
113
135
  describe "reload source" do
114
- temporary_change_hash_value(Byebug::Command.settings, :reload_source_on_change, false)
115
-
136
+ before { Byebug::Command.settings[:reload_source_on_change] = false }
116
137
  after { change_line_in_file(fullpath('list'), 4, '4') }
138
+
117
139
  it "must not reload if setting is false" do
118
140
  enter 'set noautoreload', -> do
119
141
  change_line_in_file(fullpath('list'), 4, '100')
@@ -136,7 +158,8 @@ describe "List Command" do
136
158
  it "must show an error when there is no such file" do
137
159
  enter ->{state.file = "blabla"; 'list 4-4'}
138
160
  debug_file 'list'
139
- check_output_includes "No sourcefile available for blabla", interface.error_queue
161
+ check_output_includes "No sourcefile available for blabla",
162
+ interface.error_queue
140
163
  end
141
164
 
142
165
  describe "Post Mortem" do
@@ -19,7 +19,7 @@ describe "Restart Command (test setup)" do
19
19
  "PROG_SCRIPT", Pathname.new(fullpath('restart')).
20
20
  relative_path_from(Pathname.new(Byebug::INITIAL_DIR)).
21
21
  cleanpath.to_s)
22
- set_tmp_const(Byebug, "RDEBUG_SCRIPT", 'rdebug_script')
22
+ set_tmp_const(Byebug, "RDEBUG_SCRIPT", 'byebug_script')
23
23
  set_tmp_hash(Byebug::Command.settings, :argv, ['argv'])
24
24
  Byebug::RestartCommand.any_instance.stubs(:exec).
25
25
  with("#{Byebug::RDEBUG_SCRIPT} argv")
@@ -4,7 +4,7 @@ describe "Set Command" do
4
4
  include TestDsl
5
5
 
6
6
  describe "setting to on" do
7
- temporary_change_hash_value(Byebug::Command.settings, :autolist, 0)
7
+ Byebug::Command.settings[:autolist] = 0
8
8
 
9
9
  it "must set a setting to on" do
10
10
  enter 'set autolist on'
@@ -32,7 +32,7 @@ describe "Set Command" do
32
32
  end
33
33
 
34
34
  describe "setting to off" do
35
- temporary_change_hash_value(Byebug::Command.settings, :autolist, 1)
35
+ Byebug::Command.settings[:autolist] = 1
36
36
 
37
37
  it "must set a setting to off" do
38
38
  enter 'set autolist off'
@@ -54,7 +54,7 @@ describe "Set Command" do
54
54
  end
55
55
 
56
56
  describe "messages" do
57
- temporary_change_hash_value(Byebug::Command.settings, :autolist, 0)
57
+ Byebug::Command.settings[:autolist] = 0
58
58
 
59
59
  it "must show a message after setting" do
60
60
  enter 'set autolist on'
@@ -147,7 +147,7 @@ describe "Set Command" do
147
147
  end
148
148
 
149
149
  describe "width" do
150
- temporary_change_hash_value(Byebug::Command.settings, :width, 20)
150
+ Byebug::Command.settings[:width] = 20
151
151
 
152
152
  it "must set ENV['COLUMNS'] by the 'set width' command" do
153
153
  old_columns = ENV["COLUMNS"]
@@ -162,7 +162,8 @@ describe "Set Command" do
162
162
  end
163
163
 
164
164
  describe "Post Mortem" do
165
- temporary_change_hash_value(Byebug::Command.settings, :autolist, 0)
165
+ Byebug::Command.settings[:autolist] = 0
166
+
166
167
  it "must work in post-mortem mode" do
167
168
  skip("No post morten mode for now")
168
169
  enter 'cont', "set autolist on"
@@ -1,10 +1,9 @@
1
1
  module MiniTest::Assertions
2
2
 
3
- # This matcher checks that given collection is included into the original collection,
4
- # and in correct order. It accepts both strings and regexps.
3
+ # This matcher checks that given collection is included into the original
4
+ # collection and in correct order. It accepts both strings and regexps.
5
5
  #
6
6
  # Examples:
7
- #
8
7
  # assert_includes_in_order(%w{1 2 3 4 5}, %w{1 3 5}) # => pass
9
8
  # assert_includes_in_order(%w{1 2 3 4 5}, %w{1 5 3}) # => fail
10
9
  # assert_includes_in_order(w{1 2 3 4 5}, ["1", /\d+/, "5"]) # => pass
@@ -1,12 +1,10 @@
1
1
  module Mocha
2
2
 
3
3
  class Expectation
4
-
5
4
  # Allows to specify a block to execute when expectation will be matched.
6
5
  # This way, we can specify dynamic values to return or just make some side effects
7
6
  #
8
7
  # Example:
9
- #
10
8
  # foo.expects(:bar).with('bla').calls { 2 + 3 }
11
9
  # foo.bar('bla') # => 5
12
10
  #
@@ -21,12 +19,12 @@ module Mocha
21
19
  end
22
20
  alias_method :invoke_without_calls, :invoke
23
21
  alias_method :invoke, :invoke_with_calls
24
-
25
22
  end
26
23
 
27
24
  class Mock
28
25
 
29
- # We monkey-patch that method to be able to pass arguments to Expectation#invoke method
26
+ # We monkey-patch that method to be able to pass arguments to
27
+ # Expectation#invoke method
30
28
  def method_missing(symbol, *arguments, &block)
31
29
  if @responder and not @responder.respond_to?(symbol)
32
30
  raise NoMethodError, "undefined method `#{symbol}' for #{self.mocha_inspect} which responds like #{@responder.mocha_inspect}"
@@ -59,7 +59,11 @@ module TestDsl
59
59
  is_test_block_called = false
60
60
  debug_completed = false
61
61
  exception = nil
62
+ p "Before: #{Byebug.settings[:autolist]}"
63
+ p "Before: #{Byebug.settings[:listsize]}"
62
64
  Byebug.stubs(:run_init_script)
65
+ p "After: #{Byebug.settings[:autolist]}"
66
+ p "After: #{Byebug.settings[:listsize]}"
63
67
  if block
64
68
  interface.test_block= lambda do
65
69
  is_test_block_called = true
@@ -3,8 +3,13 @@ require 'pathname'
3
3
  require 'minitest/autorun'
4
4
  require 'minitest/spec'
5
5
  require 'mocha/setup'
6
+
7
+ p "caca"
8
+
6
9
  require 'byebug'
7
10
 
11
+ p Byebug::Command.settings[:autolist]
12
+
8
13
  Dir.glob(File.expand_path("../support/*.rb", __FILE__)).each { |f| require f }
9
14
 
10
15
  Byebug.annotate = 2
@@ -82,14 +82,14 @@ describe "Variables Command" do
82
82
  end
83
83
 
84
84
  it "must cut long variable values according to :width setting" do
85
- temporary_change_hash_value(Byebug::Command.settings, :width, 20) do
86
- enter 'break 25', 'cont', 'var instance v'
87
- debug_file 'variables'
88
- check_output_includes '@inst_c = "1111111111111111...'
89
- end
85
+ Byebug::Command.settings[:width] = 20
86
+ enter 'break 25', 'cont', 'var instance v'
87
+ debug_file 'variables'
88
+ check_output_includes '@inst_c = "1111111111111111...'
90
89
  end
91
90
 
92
91
  it "must show fallback message if value doesn't have #to_s or #inspect methods" do
92
+ Byebug::Command.settings[:width] = 21
93
93
  enter 'break 25', 'cont', 'var instance v'
94
94
  debug_file 'variables'
95
95
  check_output_includes '@inst_d = *Error in evaluation*'
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: byebug
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - David Rodríguez
@@ -11,12 +10,11 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-03-29 00:00:00.000000000 Z
13
+ date: 2013-04-06 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: columnize
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
19
  - - ~>
22
20
  - !ruby/object:Gem::Version
@@ -24,7 +22,6 @@ dependencies:
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
26
  - - ~>
30
27
  - !ruby/object:Gem::Version
@@ -32,7 +29,6 @@ dependencies:
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: debugger-linecache
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
33
  - - ~>
38
34
  - !ruby/object:Gem::Version
@@ -40,7 +36,6 @@ dependencies:
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
40
  - - ~>
46
41
  - !ruby/object:Gem::Version
@@ -48,23 +43,20 @@ dependencies:
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: rake
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
47
  - - ~>
54
48
  - !ruby/object:Gem::Version
55
- version: 10.0.3
49
+ version: 10.0.4
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
54
  - - ~>
62
55
  - !ruby/object:Gem::Version
63
- version: 10.0.3
56
+ version: 10.0.4
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: rake-compiler
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
61
  - - ~>
70
62
  - !ruby/object:Gem::Version
@@ -72,7 +64,6 @@ dependencies:
72
64
  type: :development
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
68
  - - ~>
78
69
  - !ruby/object:Gem::Version
@@ -80,7 +71,6 @@ dependencies:
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: mocha
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
75
  - - ~>
86
76
  - !ruby/object:Gem::Version
@@ -88,7 +78,6 @@ dependencies:
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
82
  - - ~>
94
83
  - !ruby/object:Gem::Version
@@ -96,7 +85,6 @@ dependencies:
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: minitest
98
87
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
89
  - - ~>
102
90
  - !ruby/object:Gem::Version
@@ -104,7 +92,6 @@ dependencies:
104
92
  type: :development
105
93
  prerelease: false
106
94
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
95
  requirements:
109
96
  - - ~>
110
97
  - !ruby/object:Gem::Version
@@ -259,29 +246,25 @@ files:
259
246
  homepage: http://github.com/deivid-rodriguez/byebug
260
247
  licenses:
261
248
  - BSD
249
+ metadata: {}
262
250
  post_install_message:
263
251
  rdoc_options: []
264
252
  require_paths:
265
253
  - lib
266
254
  required_ruby_version: !ruby/object:Gem::Requirement
267
- none: false
268
255
  requirements:
269
256
  - - '>='
270
257
  - !ruby/object:Gem::Version
271
- version: '0'
272
- segments:
273
- - 0
274
- hash: 871910095
258
+ version: 2.0.0
275
259
  required_rubygems_version: !ruby/object:Gem::Requirement
276
- none: false
277
260
  requirements:
278
261
  - - '>='
279
262
  - !ruby/object:Gem::Version
280
- version: 1.3.6
263
+ version: 2.0.3
281
264
  requirements: []
282
265
  rubyforge_project:
283
- rubygems_version: 1.8.25
266
+ rubygems_version: 2.0.3
284
267
  signing_key:
285
- specification_version: 3
268
+ specification_version: 4
286
269
  summary: Ruby 2.0 fast debugger - base + cli
287
270
  test_files: []