manastech/webmock.cr

Syntax error in ./libs/webmock/webmock/stub.cr:12: can't use named tuple syntax for Hash-like literal, use '=>'

Closed this issue · 4 comments

$ crystal spec
Error in line 1: while requiring "./spec/gitlab/client_spec.cr"

in ./spec/gitlab/client_spec.cr:1: while requiring "../spec_helper"

require "../spec_helper"
^

in ./spec/spec_helper.cr:2: while requiring "webmock"

require "webmock"
^

in ./libs/webmock/webmock.cr:1: while requiring "./**"

require "./**"
^

Syntax error in ./libs/webmock/webmock/stub.cr:12: can't use named tuple syntax for Hash-like literal, use '=>'

    @headers = HTTP::Headers{"Content-length": "0"}

crystal version: 0.18.2

Fixed! I don't know what happened, I thought I pushed these changes some days ago. I even use this in other projects...

Since crystal was released 0.17.4, it always throws this exception. i changed everything to Hash.

@icyleaf what do you mean, is this still an issue for you? Maybe you need to crystal deps update on your project, after increasing the version number.

Check crystal changelog for v0.18.0

  • (breaking change) {"foo": 1} denotes a named tuple literal now, not a hash literal. Use {"foo" => 1} instead. This also applies to, for example HTTP::Headers{...}

I remove it for the moment, i will try later :)
thanks for your works 👍