Project

General

Profile

Actions

Bug #11656

closed

ruby crashes when running rspec from top level context, but not from the individual spec that is causing ruby to crash

Added by dgreenbe77 (Daniel Greenberg) almost 10 years ago. Updated over 8 years ago.

Status:
Closed
Target version:
-
[ruby-core:71338]

Description

/Users/dgreenbe77/Development/frederick_gem/lib/frederick/models/model.rb
./spec/lib/frederick/models/model_spec.rb


Files

model.rb (3.18 KB) model.rb dgreenbe77 (Daniel Greenberg), 11/04/2015 06:11 PM
model_spec.rb (4.2 KB) model_spec.rb This spec is causing the crash dgreenbe77 (Daniel Greenberg), 11/04/2015 06:11 PM
bug-11656.log (74.5 KB) bug-11656.log nobu (Nobuyoshi Nakada), 11/05/2015 05:07 AM

Updated by dgreenbe77 (Daniel Greenberg) almost 10 years ago

Attached file here because it is hard to read above.

Updated by dgreenbe77 (Daniel Greenberg) almost 10 years ago

Daniel Greenberg wrote:

Attached file here because it is hard to read above.

  describe '#hash' do
    let(:attr_vals) { subject.attr_values.to_s }

    before { expect(Digest::MD5).to receive(:hexdigest).with(attr_vals).and_call_original }

    it 'returns the stringified hash code of the instance values, code is the same over new instances of ruby' do
      expect(subject.hash).to eq hash_code
    end
  end

found when i renamed attr_values let to not be existing method name that the interpreter stopped crashing

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

What does let do?

Updated by austin (Austin Ziegler) almost 10 years ago

It creates a memoized function of the symbol name containing the value.

On Thu, Nov 5, 2015 at 12:23 AM, wrote:

Issue #11656 has been updated by Nobuyoshi Nakada.

File bug-11656.log added
Description updated
Assignee set to Koichi Sasada

What does let do?


Bug #11656: ruby crashes when running rspec from top level context, but
not from the individual spec that is causing ruby to crash
https://bugs.ruby-lang.org/issues/11656#change-54715

  • Author: Daniel Greenberg
  • Status: Open
  • Priority: Normal
  • Assignee: Koichi Sasada
  • ruby -v: ruby-2.2.3
  • Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN

/Users/dgreenbe77/Development/frederick_gem/lib/frederick/models/model.rb
./spec/lib/frederick/models/model_spec.rb

---Files--------------------------------
model.rb (3.18 KB)
model_spec.rb (4.2 KB)
bug-11656.log (74.5 KB)

--
https://bugs.ruby-lang.org/

--
Austin Ziegler •
http://www.halostatue.ca/http://twitter.com/halostatue

Updated by ko1 (Koichi Sasada) almost 10 years ago

could you try latest ruby 2.3dev?
or could you tell me how to run it?

Updated by ko1 (Koichi Sasada) over 8 years ago

  • Status changed from Open to Closed

No feedback. Please reopen this ticket if you have this trouble on recent versions.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0