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

Predicates do not match ints, floats, booleans #4

Closed
bbyars opened this Issue Apr 24, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@bbyars
Owner

bbyars commented Apr 24, 2014

One thing I ran into with configuring a stub was a predicate like this --

    {
      "deepEquals": {
        "path": "/imoji/index.php",
        "query": {
          "fb_id": 100
        },
        "method": "GET"
      }
    }

Initially I was surprised it never matched. Then I changed the query value to a string and it worked.

@moodmosaic

This comment has been minimized.

Show comment
Hide comment
@moodmosaic

moodmosaic May 5, 2014

Contributor

As it looks like, that is happening because the expected and actual JSON string values are not equal:

expected "{"fb_id": 100 }"
  actual "{"fb_id":"100"}"

The actual value should be 100, not "100".

One option is to probably try fixing the actual value. Another option is to leave actual as-is and compare the object graphs semantically using objectdiff or something similar, I think.

Contributor

moodmosaic commented May 5, 2014

As it looks like, that is happening because the expected and actual JSON string values are not equal:

expected "{"fb_id": 100 }"
  actual "{"fb_id":"100"}"

The actual value should be 100, not "100".

One option is to probably try fixing the actual value. Another option is to leave actual as-is and compare the object graphs semantically using objectdiff or something similar, I think.

bbyars added a commit that referenced this issue May 6, 2014

@bbyars

This comment has been minimized.

Show comment
Hide comment
@bbyars

bbyars May 6, 2014

Owner

Fixed with 4fa7005

Owner

bbyars commented May 6, 2014

Fixed with 4fa7005

@bbyars bbyars closed this May 6, 2014

bbyars added a commit that referenced this issue May 6, 2014

Merge pull request #11 from moodmosaic/patch-1
Removed reference to issue #4 from TODO items

bbyars added a commit that referenced this issue May 9, 2014

bbyars added a commit that referenced this issue May 9, 2014

Removed reference to issue #4 from TODO items
Removed reference to issue #4 from TODO items, since issue #4 is now resolved with [4fa7005](4fa7005).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment