-
Notifications
You must be signed in to change notification settings - Fork 38
🚑️ Remove circular dependency, fixes #55, #60 #59
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,8 @@ | |
it "has working cpu count method" do | ||
cpu_count = OS.cpu_count | ||
assert cpu_count >= 1 | ||
assert (cpu_count & (cpu_count - 1)) == 0 # CPU count is normally a power of 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I use a 6-core, 12 vCPU Macbook Pro. The power of 2 idea is no longer reasonable, so I have added "or an even number" as a secondary condition. |
||
# CPU count is usually either a power of 2 or an even number. | ||
assert ((cpu_count & (cpu_count - 1)) == 0) || ((cpu_count % 2) == 0) | ||
end | ||
|
||
it "has working cpu count method with no env. variable" do | ||
|
@@ -144,18 +145,19 @@ | |
|
||
it "should provide a path to directory for application config" do | ||
ENV.stub(:[]) | ||
home = '/home/user' | ||
|
||
if OS.mac? | ||
ENV.stub(:[]).with('HOME').and_return('/home/user') | ||
assert OS.app_config_path('appname') == '/home/xdg/Library/Application Support/appname' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's clear you weren't running this on a Mac 😄 |
||
ENV.stub(:[]).with('HOME').and_return(home) | ||
assert OS.app_config_path('appname') == "#{home}/Library/Application Support/appname" | ||
elsif OS.doze? | ||
# TODO | ||
else | ||
ENV.stub(:[]).with('HOME').and_return('/home/user') | ||
assert OS.app_config_path('appname') == '/home/user/.config/appname' | ||
ENV.stub(:[]).with('HOME').and_return(home) | ||
assert OS.app_config_path('appname') == "#{home}/.config/appname" | ||
|
||
ENV.stub(:[]).with('XDG_CONFIG_HOME').and_return('/home/xdg/.config') | ||
assert OS.app_config_path('appname') == '/home/xdg/.config/appname' | ||
ENV.stub(:[]).with('XDG_CONFIG_HOME').and_return("#{home}/.config") | ||
assert OS.app_config_path('appname') == "#{home}/.config/appname" | ||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The os gem can't depend on itself. I think this is part of the messy legacy of
jeweler
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think jeweler was auto inserting this, scary...