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

More tweaks to match the spec #11

Merged
merged 6 commits into from
May 8, 2015
Merged

More tweaks to match the spec #11

merged 6 commits into from
May 8, 2015

Conversation

bladeSk
Copy link
Contributor

@bladeSk bladeSk commented May 7, 2015

The code should now fully conform to the spec, just a few more tests are needed

bladeSk added 4 commits May 7, 2015 09:09
Merge pull request #9 from bladeSk/master
Better exception handling in tests (use error code instead of http code)
Test for invalid message types
Default limit and order test for message history
Tests for messages - decryption with mismatched params, request count on publishing an array of msgs, too large message
Removed no longer necessary AblyEncryptionException
Changed hostTimeout to match the spec
@kouno
Copy link
Contributor

kouno commented May 7, 2015

Can you rebase this on top of master? We don't need the merge commit in there.

$msg->data = 81403;

$this->setExpectedException( 'Ably\Exceptions\AblyException', '', 40003 );
$channel->publish( $msg );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this test still pass if this line wasn't throwing an exception but others did?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn, you're right! Thanks for pointing that out.

Explicit string casts in ChannelHistoryTest.php
Refactored ErrorInfo and AblyException

$this->ablyCode = $ablyCode;
public function __construct( $message, $code = 40000, $statusCode = 400 ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we need to specify a default code and statusCode.

Java needs all three (message + code + statusCode) to be present https://github.com/ably/ably-java/blob/master/src/io/ably/types/AblyException.java#L37 and Ruby uses nil by default.

If you can use null here as the default it would be nice.

@kouno
Copy link
Contributor

kouno commented May 8, 2015

Looks good to me. 👍

@mattheworiordan
Copy link
Member

Nice work, 👍

kouno added a commit that referenced this pull request May 8, 2015
More tweaks to match the spec
@kouno kouno merged commit 5bc4956 into ably:master May 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants