Skip to content
Snippets Groups Projects
Commit 929c594f authored by Markus Reiter's avatar Markus Reiter
Browse files

Add test for `MacOS.languages`.

parent 1a25f1ec
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,15 @@ require "testing_env"
require "os/mac"
class OSMacLanguageTests < Homebrew::TestCase
LANGUAGE_REGEX = /\A[a-z]{2}(-[A-Z]{2})?(-[A-Z][a-z]{3})?\Z/
def test_languages_format
OS::Mac.languages.each do |language|
assert_match LANGUAGE_REGEX, language
end
end
def test_language_format
assert_match(/\A[a-z]{2}(-[A-Z]{2})?\Z/, OS::Mac.language)
assert_match LANGUAGE_REGEX, OS::Mac.language
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment