mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Rename to TestColorProximity
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
require_relative "./helper"
|
require_relative "./helper"
|
||||||
|
|
||||||
class TestColorThreshold < Minitest::Test
|
class TestColorProximity < Minitest::Test
|
||||||
include Linguist
|
include Linguist
|
||||||
|
|
||||||
def cut_hash(color)
|
def cut_hash(color)
|
||||||
color[1..-1]
|
color[1..-1]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_color_threshold
|
def test_color_proximity
|
||||||
langs_with_colors = Language.all.reject { |language| language.color.nil? }
|
langs_with_colors = Language.all.reject { |language| language.color.nil? }
|
||||||
cp = ColorProximity.new(0.02, langs_with_colors.map { |lang| cut_hash(lang.color) })
|
cp = ColorProximity.new(0.02, langs_with_colors.map { |lang| cut_hash(lang.color) })
|
||||||
failing_threshold = langs_with_colors.map do |lang|
|
failing_threshold = langs_with_colors.map do |lang|
|
||||||
Reference in New Issue
Block a user