Update for Crystal v0.25#24
Conversation
|
Actually, it looks like the tests may be failing on master with v0.24 as well. So maybe this can be merged to get v0.25 support and then another PR for fixing the tests. For now, I'll use my forked branch in https://github.com/luckyframework/lucky_flow as it seems to work ok on v0.25 with this change :D |
|
@ysbaddaden can we get a merge on this? |
|
Is there no way to keep accessing the raw objects? I really don't like Also the patch is hard to read because of unrelated |
|
@ysbaddaden everyone conforms to the tool format, maybe you should too ;) |
|
I separated commits so you can see the format changes separate from the other changes. There may be a way to do it differently. I personally think JSON::Any is about the same, but if someone knows a better way I can update this. |
|
Still some formatting changes but mostly just stuff for JSON::Any |
| body = JSON.parse(response.body) | ||
| status = body["status"].as_i | ||
| value = body["value"] | ||
| raise Selenium.error_class(status).new(body["value"]["message"].to_s) |
There was a problem hiding this comment.
You don't need value = body["value"] anymore and it should be body["value"]["message"].as_s.
That's part of the reason I don't like JSON::Type, it introduces confusing namings: .as_x vs .to_x.
There was a problem hiding this comment.
Yeah that is confusing. I'm not sure I understand the difference :S
There was a problem hiding this comment.
Yeah that is confusing. I'm not sure I understand the difference :S
as_x: "type cast", type is alreadyxto_x: "type covert", type is notx(commonly)
There was a problem hiding this comment.
That makes sense. Thank you :)
|
|
||
| @id = response["sessionId"].as(String) | ||
| @capabilities = response["value"].as(Hash) | ||
| @id = response["sessionId"].to_s |
|
@ysbaddaden comments have ben addressed |
|
I released v0.4.0. |
|
Awesome! Thank you :) |
Still has some failing tests but it compiles. I need to read up on the JSON stuff to try to figure out why it isn't passing. I probably did something wrong.
Opening this now in case you want to take it over or have some ideas.
Thanks for an awesome lib :)