aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/os/mac_spec.rb
blob: 64178245112d47dc8bb6b52afff92b6ce7a8f94b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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