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

Fix type error on subscription show subcommand #1084

Merged
merged 1 commit into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v0.10.2 2020-11-02

* Fix type error on subscription show subcommand whith active commercial license.
[#1074](https://github.com/mbj/mutant/pull/1084)

# v0.10.1 2020-10-29

* Add support for multiple cover expressions in minitest integration [#1076](https://github.com/mbj/mutant/pull/1076)
Expand Down
2 changes: 1 addition & 1 deletion lib/mutant/license/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def self.load(world, value)
# @return [String]
def description
FORMAT % {
licensed: licensed.join("\n"),
licensed: licensed.to_a.join("\n"),
subscription_name: subscription_name
}
end
Expand Down
3 changes: 2 additions & 1 deletion lib/mutant/license/subscription/opensource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def self.from_json(value)
value
.fetch('repositories')
.map(&Repository.public_method(:parse))
.to_set
)
end

Expand All @@ -59,7 +60,7 @@ def apply(world)
private

def check_subscription(actual)
if (licensed.to_set & actual).any?
if (licensed & actual).any?
success
else
failure(licensed, actual)
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/mutant/license/subscription_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def apply
[
described_class::Commercial::Author.new('mbj@schirp-dso.com'),
described_class::Commercial::Author.new('other@schirp-dso.com')
]
].to_set
)
end

Expand All @@ -32,7 +32,7 @@ def apply
[
described_class::Opensource::Repository.new('github.com', 'mbj/mutant'),
described_class::Opensource::Repository.new('github.com', 'mbj/unparser')
]
].to_set
)
end

Expand Down Expand Up @@ -109,7 +109,7 @@ def self.it_fails_with_message(expected)
'github.com',
'mbj/mutant'
)
]
].to_set
)
end

Expand Down