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

Convert os/mac/language test to spec. #2082

Merged
merged 1 commit into from Feb 23, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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