Skip to content

Adds OperatingSystem enum.#4

Merged
coollog merged 2 commits intomasterfrom
1-operating-system-enum
Aug 6, 2018
Merged

Adds OperatingSystem enum.#4
coollog merged 2 commits intomasterfrom
1-operating-system-enum

Conversation

@coollog
Copy link
Copy Markdown
Contributor

@coollog coollog commented Aug 6, 2018

This is useful for resolving which binary of skaffold to download.

@coollog coollog requested a review from a team August 6, 2018 21:48
return resolve(System.getProperties());
}

static OperatingSystem resolve(Properties properties) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VisibleForTesting

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually used by UserCacheHome (for testability). The other resolve will be useful for other classes that do not need fake out the Properties.

WINDOWS;

/**
* Resolves the operating system type. *
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stranded * at the end

@Test
public void testMacOs() {
Properties fakeProperties = new Properties();
fakeProperties.setProperty("os.name", "os is mAc or DaRwIn");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better to split this into two cases: mAc and DaRwIn.

@coollog coollog merged commit a3efc99 into master Aug 6, 2018
@coollog coollog deleted the 1-operating-system-enum branch August 6, 2018 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants