Skip to content

Commit

Permalink
Merge pull request #2082 from reitermarkus/spec-os_mac_language
Browse files Browse the repository at this point in the history
Convert `os/mac/language` test to spec.
  • Loading branch information
reitermarkus committed Feb 23, 2017
2 parents c4bfdb5 + 48a211f commit 76ca97b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
4 changes: 1 addition & 3 deletions Library/Homebrew/dev-cmd/tests.rb
Expand Up @@ -57,9 +57,7 @@ def tests
ENV["SEED"] = ARGV.next if ARGV.include? "--seed"

files = Dir.glob("test/**/*_{spec,test}.rb")
.reject { |p| !OS.mac? && p.start_with?("test/os/mac/") }
.reject { |p| !OS.mac? && p.start_with?("test/cask/") }
.reject { |p| p.start_with?("test/vendor/bundle/") }
.reject { |p| !OS.mac? && p =~ %r{^test/(os/mac|cask)(/.*|_(test|spec)\.rb)$} }

test_args = []
test_args << "--trace" if ARGV.include? "--trace"
Expand Down
19 changes: 0 additions & 19 deletions Library/Homebrew/test/os/mac/language_test.rb

This file was deleted.

22 changes: 22 additions & 0 deletions Library/Homebrew/test/os/mac_spec.rb
@@ -0,0 +1,22 @@
require "locale"
require "os/mac"

describe OS::Mac do
describe "::languages" do
specify "all languages can be parsed by Locale::parse" do
subject.languages.each do |language|
expect { Locale.parse(language) }.not_to raise_error
end
end
end

describe "::language" do
it "returns the first item from #languages" do
expect(subject.language).to eq(subject.languages.first)
end

it "can be parsed by Locale::parse" do
expect { Locale.parse(subject.language) }.not_to raise_error
end
end
end

0 comments on commit 76ca97b

Please sign in to comment.