Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with OpenStruct in Ruby 2.3 #102

Open
soylent opened this issue Dec 30, 2015 · 0 comments
Open

Issue with OpenStruct in Ruby 2.3 #102

soylent opened this issue Dec 30, 2015 · 0 comments

Comments

@soylent
Copy link

soylent commented Dec 30, 2015

Probably the recent changes in ostruct in ruby 2.3 cause the following problem:

require 'spec_helper'

describe 'rr ostruct err' do
  it 'fails' do
    open_struct = OpenStruct.new(foo: :bar)

    mock(open_struct).stubbed { 'stubbed_value' }
    open_struct.stubbed

    expect(open_struct.foo).to eq :bar # PASSES
    expect(open_struct.foo).to eq :bar # FAILS

    # Failures:
    #
    #   1) ostruct err fails
    #      Failure/Error: expect(open_struct.foo).to eq :bar # FAILS
    #      RR::Errors::DoubleNotFoundError:
    #        On subject #<OpenStruct foo=:bar>,
    #        unexpected method invocation:
    #          foo()
    #        expected invocations:
    #      # ./spec/ostruct_spec.rb:11:in `block (2 levels) in <top (required)>'
    #      # -e:1:in `<main>'
  end
end

Please also see the changes in ostruct: ruby/ruby@3bf9b2f

kou referenced this issue in rr/rr May 29, 2016
GitHub: fix #102

Reported by soylent. Thanks!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant