Skip to content
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

1 maybe 2 issues with 'AboutMeasureObject.Koans.ps1' #340

Closed
ghost opened this issue Jan 6, 2020 · 2 comments · Fixed by #347
Closed

1 maybe 2 issues with 'AboutMeasureObject.Koans.ps1' #340

ghost opened this issue Jan 6, 2020 · 2 comments · Fixed by #347
Assignees
Labels
Category-Koans Invoking the Great Doubt Issue-Enhancement 🎉 Make it better!

Comments

@ghost
Copy link

ghost commented Jan 6, 2020

ISSUE 1: 'can operate on object properties'

Well Averages can be challenging especially when the resulting average can have a seemingly endless number of significant digits. I would propose that you limit the number of significant digits in some manner otherwise it is going to be hit and miss for passing this test.

Original Line 80:

__ | Should -Be $Data.Average

Modified Line 80:

__ | Should -Be Should -Be ([math]::Round($Data.Average,4))

ISSUE 2: 'can measure text lines, characters, and words of strings'

EXCEPT when the file does not exist, then the answers are always zero (0). If this was your intent then this isn't an issue, otherwise it might be wise to have a file that exists as part of the data. I just picked a file and plugged it in.

Original line 84:

T e x t = G e t C o n t e n t " (Get-PSKoanLocation)/Foundations/AboutTheStockChallenge.Koans.ps1"

Modified line 84

Depends on the intent of the developers.

@ghost ghost added Category-Koans Invoking the Great Doubt Issue-Discussion Let's talk about it! labels Jan 6, 2020
@vexx32
Copy link
Owner

vexx32 commented Jan 6, 2020

Yeah, agreed on the rounding issue. For the latter point, it might be a better call to simply include a few lines of text in the koan file itself rather than trying to read another file.

@vexx32 vexx32 added Hacktoberfest 💻 Issue-Enhancement 🎉 Make it better! Up For Grabs / Hacktoberfest 💻 If it's Up For Grabs, take it and run with it! If not, ask if it's in progress / you can take it. and removed Issue-Discussion Let's talk about it! labels Jan 6, 2020
@ghost
Copy link
Author

ghost commented Jan 7, 2020

How about this for a modification to line 84

$Text = Get-Content $PSCommandPath

This may have some folk scratching their heads, until they google it, of course.

@vexx32 vexx32 removed Hacktoberfest 💻 Up For Grabs / Hacktoberfest 💻 If it's Up For Grabs, take it and run with it! If not, ask if it's in progress / you can take it. labels Jan 15, 2020
@vexx32 vexx32 self-assigned this Jan 18, 2020
vexx32 added a commit that referenced this issue Jan 18, 2020
vexx32 added a commit that referenced this issue Jan 19, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* 🔧 Resolve issues in AboutModules

Fixes #342

* 🔧 Fix issues in AboutTeeObject

Fixes #341

Also added a new koan to show when the variable is created

* 🔧 Fix issues in AboutMeasureObject

Fixes #340

* 🔧 Fix issues in AboutSelectObject

Fixes #339

Fixes #337

* 🔧 Fix issue in AboutAssignmentAndArithmetic

Fixes #334

* 🔧 Fix issues in AboutDiscovery

Fixes #335

Fixes #332

* 🔧 ♻️ Fix up AboutArrays

Fixes #330

* 🔧 Fix missing variable reference

* 🎨 Update format of array declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category-Koans Invoking the Great Doubt Issue-Enhancement 🎉 Make it better!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant