Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 5507b69

Browse files
committed
Merge pull request #2102 from bootstraponline/memory_leak
Don't reset before_context_ivars in reset_memoized
2 parents 952909f + 7d8eae8 commit 5507b69

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

lib/rspec/core/example_group.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ def self.reset_memoized
348348
@_descendants = nil
349349
@parent_groups = nil
350350
@declaration_line_numbers = nil
351-
@before_context_ivars = nil
352351
end
353352

354353
# Adds an example to the example group

lib/rspec/core/rake_task.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
RSpec::Support.require_rspec_support "ruby_features"
66

7+
# :nocov:
78
unless RSpec::Support.respond_to?(:require_rspec_core)
89
RSpec::Support.define_optimized_require_for_rspec(:core) { |f| require_relative "../#{f}" }
910
end
11+
# :nocov:
1012

1113
RSpec::Support.require_rspec_core "shell_escape"
1214

spec/rspec/core/example_group_spec.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,9 +1796,7 @@ def group_ids group
17961796

17971797
group.add_example group.examples.first
17981798
expect(group.examples.length).to eq(2)
1799-
1800-
new_ids = group_ids group
1801-
new_ids.each_with_index { |id, idx| expect(id).to_not eq(original_ids[idx]) }
1799+
expect(original_ids).to_not eq(group_ids(group))
18021800
end
18031801

18041802
it 'allows removing examples' do
@@ -1813,9 +1811,7 @@ def group_ids group
18131811

18141812
group.remove_example group.examples.first
18151813
expect(group.examples.length).to eq(0)
1816-
1817-
new_ids = group_ids group
1818-
new_ids.each_with_index { |id, idx| expect(id).to_not eq(original_ids[idx]) }
1814+
expect(original_ids).to_not eq(group_ids(group))
18191815
end
18201816
end
18211817
end

0 commit comments

Comments
 (0)