Skip to content

Commit

Permalink
- copy the two examples to the CoverageDemo class
Browse files Browse the repository at this point in the history
This way it does not need to reference any class from the tests and is self-contained

fixes pharo-project#4232
  • Loading branch information
MarcusDenker committed Nov 6, 2019
1 parent 6f49357 commit c09d179
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/Reflectivity-Examples/CoverageDemo.class.st
Expand Up @@ -30,6 +30,19 @@ CoverageDemo class >> defaultSpec [
yourself
]

{ #category : #example }
CoverageDemo class >> exampleIfTrueIfFalse [
| t |
t := false.
t ifTrue: [ self bar ] ifFalse: [ 'hello' ].
^ 5
]

{ #category : #example }
CoverageDemo class >> exampleMethod [
^ 2 + 3
]

{ #category : #open }
CoverageDemo class >> open [
<script>
Expand Down Expand Up @@ -75,17 +88,17 @@ CoverageDemo >> exampleMethod [
{ #category : #example }
CoverageDemo >> exampleNotCompleteCoverage [

self coverageCode: [ ReflectivityExamples new exampleIfTrueIfFalse. ].
self compiledMethods add: ReflectivityExamples>>#exampleIfTrueIfFalse.
self coverageCode: [ CoverageDemo exampleIfTrueIfFalse. ].
self compiledMethods add: CoverageDemo class >>#exampleIfTrueIfFalse.

self openWithSpec.
]

{ #category : #initialization }
CoverageDemo >> initialize [
coverageCode := [ ReflectivityExamples new exampleMethod ].
coverageCode := [ CoverageDemo exampleMethod ].
compiledMethods := OrderedCollection new.
compiledMethods add: ReflectivityExamples >> #exampleMethod.
compiledMethods add: CoverageDemo class >> #exampleMethod.

super initialize
]
Expand Down

0 comments on commit c09d179

Please sign in to comment.