mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Only capture splat if it has a name
This commit is contained in:
parent
0f8c46d6ef
commit
faff2933e6
2 changed files with 5 additions and 2 deletions
|
@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Added
|
||||
- Added ability to cast types using the return value from expect statements with a type matcher.
|
||||
|
||||
### Fixed
|
||||
- Fix invalid syntax (unterminated call) when recording calls to stubs with an un-named splat.
|
||||
|
||||
## [0.11.5] - 2022-12-18
|
||||
### Added
|
||||
- Added support for mock modules and types that include mocked modules.
|
||||
|
|
|
@ -180,7 +180,7 @@ module Spectator
|
|||
::NamedTuple.new(
|
||||
{% for arg, i in method.args %}{% if !method.splat_index || i < method.splat_index %}{{arg.internal_name.stringify}}: {{arg.internal_name}}, {% end %}{% end %}
|
||||
),
|
||||
{% if method.splat_index && (splat = method.args[method.splat_index].internal_name) %}{{splat.symbolize}}, {{splat}},{% end %}
|
||||
{% if method.splat_index && !(splat = method.args[method.splat_index].internal_name).empty? %}{{splat.symbolize}}, {{splat}},{% end %}
|
||||
::NamedTuple.new(
|
||||
{% for arg, i in method.args %}{% if method.splat_index && i > method.splat_index %}{{arg.internal_name.stringify}}: {{arg.internal_name}}, {% end %}{% end %}
|
||||
).merge({{method.double_splat}})
|
||||
|
@ -332,7 +332,7 @@ module Spectator
|
|||
::NamedTuple.new(
|
||||
{% for arg, i in method.args %}{% if !method.splat_index || i < method.splat_index %}{{arg.internal_name.stringify}}: {{arg.internal_name}}, {% end %}{% end %}
|
||||
),
|
||||
{% if method.splat_index && (splat = method.args[method.splat_index].internal_name) %}{{splat.symbolize}}, {{splat}},{% end %}
|
||||
{% if method.splat_index && !(splat = method.args[method.splat_index].internal_name).empty? %}{{splat.symbolize}}, {{splat}},{% end %}
|
||||
::NamedTuple.new(
|
||||
{% for arg, i in method.args %}{% if method.splat_index && i > method.splat_index %}{{arg.internal_name.stringify}}: {{arg.internal_name}}, {% end %}{% end %}
|
||||
).merge({{method.double_splat}})
|
||||
|
|
Loading…
Reference in a new issue