sys-uname 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +7 -0
- data/Gemfile +2 -7
- data/README.md +21 -6
- data/Rakefile +4 -2
- data/doc/uname.rdoc +1 -1
- data/lib/sys/platform.rb +17 -13
- data/lib/sys/uname.rb +3 -1
- data/lib/sys/unix/uname.rb +20 -35
- data/lib/sys/windows/uname.rb +221 -237
- data/lib/sys-uname.rb +2 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/sys_platform_spec.rb +32 -38
- data/spec/sys_uname_spec.rb +140 -136
- data/sys-uname.gemspec +11 -7
- data.tar.gz.sig +0 -0
- metadata +36 -5
- metadata.gz.sig +0 -0
data/lib/sys-uname.rb
CHANGED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rspec'
|
4
|
+
require 'sys/uname'
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.filter_run_excluding(:solaris) unless RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i
|
8
|
+
config.filter_run_excluding(:bsd) unless RbConfig::CONFIG['host_os'] =~ /powerpc|darwin|macos|bsd/i
|
9
|
+
config.filter_run_excluding(:hpux) unless RbConfig::CONFIG['host_os'] =~ /hpux/i
|
10
|
+
config.filter_run_excluding(:linux) unless RbConfig::CONFIG['host_os'] =~ /linux/i
|
11
|
+
config.filter_run_excluding(:windows) unless Gem.win_platform?
|
12
|
+
end
|
data/spec/sys_platform_spec.rb
CHANGED
@@ -1,75 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
##############################################################################
|
2
4
|
# sys_platform_spec.rb
|
3
5
|
#
|
4
6
|
# Test suite for the Sys::Platform class.
|
5
7
|
##############################################################################
|
6
|
-
require '
|
7
|
-
require 'sys/uname'
|
8
|
-
require 'rbconfig'
|
8
|
+
require 'spec_helper'
|
9
9
|
|
10
10
|
RSpec.describe Sys::Platform do
|
11
|
-
|
12
|
-
|
13
|
-
@host_os = RbConfig::CONFIG['host_os']
|
14
|
-
@windows = @host_os =~ /mingw|mswin|windows/i ? true : false
|
15
|
-
end
|
16
|
-
|
17
|
-
example "the VERSION constant is set to the expected value" do
|
18
|
-
expect(Sys::Platform::VERSION).to eql('1.2.2')
|
11
|
+
example 'the VERSION constant is set to the expected value' do
|
12
|
+
expect(Sys::Platform::VERSION).to eql('1.2.3')
|
19
13
|
expect(Sys::Platform::VERSION).to be_frozen
|
20
14
|
end
|
21
15
|
|
22
|
-
example
|
16
|
+
example 'the ARCH constant is defined' do
|
23
17
|
expect(Sys::Platform::ARCH).to be_kind_of(Symbol)
|
24
18
|
end
|
25
19
|
|
26
|
-
example
|
20
|
+
example 'the OS constant is defined' do
|
27
21
|
expect(Sys::Platform::OS).to be_kind_of(Symbol)
|
28
22
|
end
|
29
23
|
|
30
|
-
example
|
24
|
+
example 'the IMPL constant is defined' do
|
31
25
|
expect(Sys::Platform::IMPL).to be_kind_of(Symbol)
|
32
26
|
end
|
33
27
|
|
34
|
-
example
|
35
|
-
expect(
|
28
|
+
example 'the IMPL returns an expected value on windows', :windows do
|
29
|
+
expect(%i[mingw mswin]).to include(Sys::Platform::IMPL)
|
36
30
|
end
|
37
31
|
|
38
|
-
example
|
39
|
-
expect(
|
40
|
-
expect(
|
32
|
+
example 'the mac? method is defined and returns a boolean' do
|
33
|
+
expect(described_class).to respond_to(:mac?)
|
34
|
+
expect(described_class.mac?).to eql(true).or eql(false)
|
41
35
|
end
|
42
36
|
|
43
|
-
example
|
44
|
-
expect(
|
45
|
-
expect(
|
37
|
+
example 'the windows? method is defined and returns a boolean' do
|
38
|
+
expect(described_class).to respond_to(:windows?)
|
39
|
+
expect(described_class.windows?).to eql(true).or eql(false)
|
46
40
|
end
|
47
41
|
|
48
|
-
example
|
49
|
-
expect(
|
42
|
+
example 'the windows? method returns the expected value' do
|
43
|
+
expect(described_class.windows?).to eql(Gem.win_platform?)
|
50
44
|
end
|
51
45
|
|
52
|
-
example
|
53
|
-
expect(
|
54
|
-
expect(
|
46
|
+
example 'the unix? method is defined and returns a boolean' do
|
47
|
+
expect(described_class).to respond_to(:unix?)
|
48
|
+
expect(described_class.unix?).to eql(true).or eql(false)
|
55
49
|
end
|
56
50
|
|
57
|
-
example
|
58
|
-
expect(
|
51
|
+
example 'the unix? method returns the expected value' do
|
52
|
+
expect(described_class.unix?).not_to eql(Gem.win_platform?)
|
59
53
|
end
|
60
54
|
|
61
|
-
example
|
62
|
-
expect(
|
63
|
-
expect(
|
55
|
+
example 'the solaris? method is defined and returns a boolean' do
|
56
|
+
expect(described_class).to respond_to(:solaris?)
|
57
|
+
expect(described_class.solaris?).to eql(true).or eql(false)
|
64
58
|
end
|
65
59
|
|
66
|
-
example
|
67
|
-
expect(
|
68
|
-
expect(
|
60
|
+
example 'the linux? method is defined and returns a boolean' do
|
61
|
+
expect(described_class).to respond_to(:linux?)
|
62
|
+
expect(described_class.linux?).to eql(true).or eql(false)
|
69
63
|
end
|
70
64
|
|
71
|
-
example
|
72
|
-
expect(
|
73
|
-
expect(
|
65
|
+
example 'the bsd? method is defined and returns a boolean' do
|
66
|
+
expect(described_class).to respond_to(:bsd?)
|
67
|
+
expect(described_class.bsd?).to eql(true).or eql(false)
|
74
68
|
end
|
75
69
|
end
|