Skip to content

Commit

Permalink
Merge 9ad3a2a into 05f0499
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Jan 3, 2019
2 parents 05f0499 + 9ad3a2a commit 811eddc
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 4 deletions.
11 changes: 11 additions & 0 deletions source/BaselineOfBuoy/BaselineOfBuoy.class.st
Expand Up @@ -18,6 +18,7 @@ BaselineOfBuoy >> baseline: spec [
baselineCollections: spec;
baselineConditions: spec;
baselineDynamicBinding: spec;
baselineExceptionHandling: spec;
baselineMath: spec;
baselineMetaprogramming: spec;
baselineSUnit: spec;
Expand Down Expand Up @@ -68,6 +69,16 @@ BaselineOfBuoy >> baselineDynamicBinding: spec [
group: 'Tests' with: 'Buoy-Dynamic-Binding-Tests'
]

{ #category : #baselines }
BaselineOfBuoy >> baselineExceptionHandling: spec [

spec
package: 'Buoy-Exception-Handling';
group: 'Deployment' with: 'Buoy-Exception-Handling';
package: 'Buoy-Exception-Handling-Tests' with: [ spec requires: 'Buoy-Exception-Handling' ];
group: 'Tests' with: 'Buoy-Exception-Handling-Tests'
]

{ #category : #baselines }
BaselineOfBuoy >> baselineMath: spec [

Expand Down
1 change: 0 additions & 1 deletion source/Buoy-Exception-Handling-System-Tests/package.st

This file was deleted.

1 change: 0 additions & 1 deletion source/Buoy-Exception-Handling-System/package.st

This file was deleted.

Expand Up @@ -4,7 +4,7 @@ I'm a test case for the exception handling system.
Class {
#name : #ExceptionHandlingSystemTest,
#superclass : #TestCase,
#category : #'Buoy-Exception-Handling-System-Tests'
#category : #'Buoy-Exception-Handling-Tests'
}

{ #category : #private }
Expand Down
1 change: 1 addition & 0 deletions source/Buoy-Exception-Handling-Tests/package.st
@@ -0,0 +1 @@
Package { #name : #'Buoy-Exception-Handling-Tests' }
@@ -1,6 +1,6 @@
Extension { #name : #BlockClosure }

{ #category : #'*Buoy-Exception-Handling-System' }
{ #category : #'*Buoy-Exception-Handling' }
BlockClosure >> on: selector except: exclusionSelector do: action [

^ self
Expand Down
1 change: 1 addition & 0 deletions source/Buoy-Exception-Handling/package.st
@@ -0,0 +1 @@
Package { #name : #'Buoy-Exception-Handling' }
28 changes: 28 additions & 0 deletions source/Buoy-Math-Tests/PerMilleTest.class.st
Expand Up @@ -17,6 +17,34 @@ PerMilleTest >> testAbs [
assert: -15 perMille abs printString equals: '15‰'
]

{ #category : #'tests - converting' }
PerMilleTest >> testAsFloat [

self
assert: 0 perMille asFloat equals: 0.0;
assert: 1000 perMille asFloat equals: 1.0;
assert: 500 perMille asFloat equals: 0.5;
assert: 5.0 perMille asFloat equals: 0.005
]

{ #category : #'tests - converting' }
PerMilleTest >> testAsFraction [

self
assert: 0 perMille asFraction equals: 0;
assert: 1000 perMille asFraction equals: 1;
assert: 500 perMille asFraction equals: 1 / 2
]

{ #category : #'tests - converting' }
PerMilleTest >> testAsNumber [

self
assert: 0 perMille asNumber equals: 0;
assert: 1000 perMille asNumber equals: 1;
assert: 500 perMille asNumber equals: 1 / 2
]

{ #category : #'tests-magnitude-API' }
PerMilleTest >> testBetweenAnd [

Expand Down
28 changes: 28 additions & 0 deletions source/Buoy-Math-Tests/PercentageTest.class.st
Expand Up @@ -17,6 +17,34 @@ PercentageTest >> testAbs [
assert: (Percentage of: -15) abs printString equals: '15%'
]

{ #category : #'tests - converting' }
PercentageTest >> testAsFloat [

self
assert: 0 percent asFloat equals: 0.0;
assert: 100 percent asFloat equals: 1.0;
assert: 50 percent asFloat equals: 0.5;
assert: 5.0 percent asFloat equals: 0.05
]

{ #category : #'tests - converting' }
PercentageTest >> testAsFraction [

self
assert: Percentage zero asFraction equals: 0;
assert: Percentage oneHundred asFraction equals: 1;
assert: ( Percentage of: 50 ) asFraction equals: 1 / 2
]

{ #category : #'tests - converting' }
PercentageTest >> testAsNumber [

self
assert: 0 percent asNumber equals: 0;
assert: 100 percent asNumber equals: 1;
assert: 50 percent asNumber equals: 1 / 2
]

{ #category : #'tests-magnitude-API' }
PercentageTest >> testBetweenAnd [

Expand Down
6 changes: 6 additions & 0 deletions source/Buoy-Math/PartsPerFraction.class.st
Expand Up @@ -86,6 +86,12 @@ PartsPerFraction >> asFloat [
^ ratio asFloat
]

{ #category : #converting }
PartsPerFraction >> asFraction [

^ ratio asFraction
]

{ #category : #converting }
PartsPerFraction >> asNumber [

Expand Down

0 comments on commit 811eddc

Please sign in to comment.