Skip to content

Commit

Permalink
Fix RUBY_DESCRIPTION and add macOS kernel version
Browse files Browse the repository at this point in the history
  • Loading branch information
andrykonchin committed Jun 7, 2024
1 parent 72ff3e5 commit 4c7ac34
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions library/rbconfig/rbconfig_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,32 @@
end
end
end

describe "RUBY_PLATFORM" do
it "RUBY_PLATFORM contains a proper CPU architecture" do
RUBY_PLATFORM.should.include? RbConfig::CONFIG['host_cpu']
end

guard -> { platform_is(:linux) || platform_is(:darwin) } do
it "RUBY_PLATFORM contains OS name" do
# don't use RbConfig::CONFIG['host_os'] as far as it could be slightly different, e.g. linux-gnu
platform_is(:linux) do
RUBY_PLATFORM.should.include? 'linux'
end

platform_is(:darwin) do
RUBY_PLATFORM.should.include? 'darwin'
end
end
end
end

describe "RUBY_DESCRIPTION" do
it "contains version" do
RUBY_DESCRIPTION.should.include? RUBY_VERSION
end

it "contains RUBY_PLATFORM" do
RUBY_DESCRIPTION.should.include? RUBY_PLATFORM
end
end

0 comments on commit 4c7ac34

Please sign in to comment.