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

Predicates do not match ints, floats, booleans #4

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

Predicates do not match ints, floats, booleans #4

bbyars opened this issue Apr 24, 2014 · 2 comments

Comments

@bbyars
Copy link
Owner

@bbyars 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
Copy link
Contributor

@moodmosaic 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
other than deepEquals, in reseaching
#4
bbyars added a commit that referenced this issue May 6, 2014
@bbyars
Copy link
Owner Author

@bbyars 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
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, 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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants