Skip to content

Commit

Permalink
Fix type error on subscription show subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj committed Nov 2, 2020
1 parent 7fe5061 commit 79ed899
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.10.2 2020-11-02

* Fix type error on subscription show subcommand.

# 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

0 comments on commit 79ed899

Please sign in to comment.