Closed junaruga closed 4 years ago
ping.
Adding {} like this is grammatically not correct.
Can you explain what you mean?
I just wanted to say { ... }
in {"/foo" => "/bar"}
in following line is not correct.
+ subject(:mapper) { Mustermann::Mapper.new(additional_values: :raise, type: :rails, {"/foo" => "/bar"}) }
$ git diff
diff --git a/mustermann/spec/mapper_spec.rb b/mustermann/spec/mapper_spec.rb
index 784a856..25150c3 100644
--- a/mustermann/spec/mapper_spec.rb
+++ b/mustermann/spec/mapper_spec.rb
@@ -33,7 +33,7 @@ describe Mustermann::Mapper do
end
context 'allows specifying type' do
- subject(:mapper) { Mustermann::Mapper.new(additional_values: :raise, type: :rails, "/foo" => "/bar") }
+ subject(:mapper) { Mustermann::Mapper.new(additional_values: :raise, type: :rails, {"/foo" => "/bar"}) }
its(:to_h) { should be == { Mustermann.new("/foo", type: :rails) => Mustermann::Expander.new("/bar", type: :rails) } }
example { mapper['/foo'].should be == '/bar' }
example { mapper['/fox'].should be == '/fox' }
$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
$ ruby -cW mustermann/spec/mapper_spec.rb
mustermann/spec/mapper_spec.rb:36: syntax error, unexpected ')', expecting =>
...pe: :rails, {"/foo" => "/bar"}) }
mustermann/spec/mapper_spec.rb:40: syntax error, unexpected end, expecting '}'
end
mustermann/spec/mapper_spec.rb:84: syntax error, unexpected end-of-input, expecting end
Hey @junaruga, sorry for the late reply. I can't merge this because of conflicts, and I need to release a new version asap. But I put your name in our release notes, please check it out.
But I put your name in our release notes, please check it out.
Hi namusyaka, sure. I checked it now, and it's okay.
I tried to add Ruby 2.6 case to Travis CI. But on Ruby 2.6 the keyword arguments allow only
Symbol
.Hash
argument with the keyword argument should specifyHash
with {}.In the a test code of mustermann, there are tests to check the order of the hash object key word argument and another keyword argument as a option. This tests have to be changed to some better way.
There are error messages like this.
How to fix it? Adding
{}
like this is grammatically not correct.