Skip to content

Commit

Permalink
Spec: silence errors from system_spec on BSD platforms (#6289)
Browse files Browse the repository at this point in the history
jcs authored and RX14 committed Jun 29, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3696bb1 commit bfd9e6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/std/system_spec.cr
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ describe System do

describe "cpu_count" do
it "returns current CPU count" do
shell_cpus = `getconf _NPROCESSORS_ONLN || nproc --all || grep -c '^processor' /proc/cpuinfo || sysctl -n hw.ncpu`.to_i
shell_cpus = `getconf _NPROCESSORS_ONLN 2>/dev/null || nproc --all 2>/dev/null || grep -sc '^processor' /proc/cpuinfo || sysctl -n hw.ncpu 2>/dev/null`.to_i
cpu_count = System.cpu_count
cpu_count.should eq(shell_cpus)
end

0 comments on commit bfd9e6d

Please sign in to comment.