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

stack level too deep #42

Open
m5rk opened this issue Jun 14, 2018 · 1 comment
Open

stack level too deep #42

m5rk opened this issue Jun 14, 2018 · 1 comment

Comments

@m5rk
Copy link

m5rk commented Jun 14, 2018

This rather benign appearing spec:

        it 'loses its mind' do
          expect({
            m: [
              {
                s: {
                  a: :i,
                  b: "",
                  c: :r
                }
              }
            ],
            s: {
              a: :o,
              b: nil,
              c: :r
            }
          }).to match_json_expression({
            m: [
              {
                s: {
                  a: :i,
                  b: "",
                  c: :r
                }
              }
            ],
            s: {
              a: :o,
              b: nil,
              c: :r
            }
          })
        end

blows up:

  Failure/Error: expect({
  SystemStackError:
    stack level too deep
@m5rk
Copy link
Author

m5rk commented Jun 14, 2018

Note, calling .to_json fixes this, but I still think you may want to address this issue (by coercing the input to json or blowing up if it's not):

expect(foo.to_json).to match_json_expression(json)

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