JsonMatchers Int treated as Double

11 views
Skip to first unread message

Nimrod Argov

unread,
Feb 25, 2015, 8:08:46 AM2/25/15
to specs2...@googlegroups.com
Hi,

We've just upgraded to 2.4.11, and the following test fails (also tested with 2.4.15):

class JsonMatchersTest extends Specification with JsonMatchers{
"A JsonMatcher" should {
"Read an Int as an Int" in {
"""{"value":5}""" must /("value" -> 5)
}
}
}

The error is:

{value:5.0} doesn't contain 'value':'5'

Seems that all numbers are read as doubles, even if they have no decimal point.

etorreborre

unread,
Feb 25, 2015, 4:58:21 PM2/25/15
to specs2...@googlegroups.com
That's a bug occurring after the JsonMatchers refactoring, sorry.

It is fixed in 2.4.17-SNAPSHOT, thanks for confirming it works for you.

Eric.

Nimrod Argov

unread,
Feb 26, 2015, 1:59:44 AM2/26/15
to specs2...@googlegroups.com
Great, thanks, I'll try it out.
Also, I was wondering, it seems that the implementation is based on the scala json library, which I understand is to be removed in 2.12.
Do you know if this is true, and if so, are you planning to rewrite it?

Thanks again,

Nimrod

--
You received this message because you are subscribed to a topic in the Google Groups "specs2-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/specs2-users/7z1_UaDMRGA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to specs2-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Nimrod Argov
Software Developer

40 Hanamal street, Tel Aviv, Israel


etorreborre

unread,
Feb 26, 2015, 6:34:55 AM2/26/15
to specs2...@googlegroups.com
I have inlined those classes in specs2 3.0 to avoid compatibility issues in the future.

Eric.


On Thursday, February 26, 2015 at 5:59:44 PM UTC+11, Nimrod Argov wrote:
Great, thanks, I'll try it out.
Also, I was wondering, it seems that the implementation is based on the scala json library, which I understand is to be removed in 2.12.
Do you know if this is true, and if so, are you planning to rewrite it?

Thanks again,

Nimrod
On Wed, Feb 25, 2015 at 11:58 PM, etorreborre <etorr...@gmail.com> wrote:
That's a bug occurring after the JsonMatchers refactoring, sorry.

It is fixed in 2.4.17-SNAPSHOT, thanks for confirming it works for you.

Eric.


On Thursday, February 26, 2015 at 12:08:46 AM UTC+11, Nimrod Argov wrote:
Hi,

We've just upgraded to 2.4.11, and the following test fails (also tested with 2.4.15):

class JsonMatchersTest extends Specification with JsonMatchers{
"A JsonMatcher" should {
"Read an Int as an Int" in {
"""{"value":5}""" must /("value" -> 5)
}
}
}

The error is:

{value:5.0} doesn't contain 'value':'5'

Seems that all numbers are read as doubles, even if they have no decimal point.

--
You received this message because you are subscribed to a topic in the Google Groups "specs2-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/specs2-users/7z1_UaDMRGA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to specs2-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages