Skip to content

Commit

Permalink
Issue Metacello#331: additional test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed Feb 19, 2015
1 parent 4c6aa3e commit 2660326
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tests
testIssue331
testIssue331A
"https://github.com/dalehenrich/metacello-work/issues/331"

"Load ExternalRef and verify that registration of External project is a baseline ..."
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
tests
testIssue331B
"https://github.com/dalehenrich/metacello-work/issues/331"

"Load ExternalRef and verify that registration of External project is a baseline ..."

| registration spec |
Metacello new
configuration: 'ExternalRef';
repository: 'dictionary://Metacello_Configuration_Test_Repository';
get.
Metacello new
configuration: 'ExternalRef';
version: '0.9.1';
repository: 'dictionary://Metacello_Configuration_Test_Repository';
load.
registration := Metacello registrations
detect: [ :each | each projectName = 'External' ].
spec := registration projectSpec.
self assert: spec versionString = '0.9.1'.
self
assert:
spec project configuration class = (Smalltalk at: #'ConfigurationOfExternal') "diagnostic for this bug"
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
tests
testIssue331C
"https://github.com/dalehenrich/metacello-work/issues/331"

"Load ExternalRef and verify that registration of External project is a baseline ..."

| registration spec |
Gofer new
version: 'ConfigurationOfExternal-dkh.1';
version: 'ConfigurationOfExternalRef-dkh.1';
repository: externalRepository;
load.
Metacello new
configuration: 'ExternalRef';
repository: 'dictionary://Metacello_Configuration_Test_Repository';
get.
Metacello new
configuration: 'ExternalRef';
version: '0.9.1';
repository: 'dictionary://Metacello_Configuration_Test_Repository';
load. "should force ConfigurationOfExternal-dkh.2 to be loaded"
registration := Metacello registrations
detect: [ :each | each projectName = 'External' ].
spec := registration projectSpec.
self assert: spec versionString = '0.9.1'.
self
assert:
spec project configuration class = (Smalltalk at: #'ConfigurationOfExternal') "diagnostic for this bug"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
tests
testIssue331D
"https://github.com/dalehenrich/metacello-work/issues/331"

"Load ExternalRef and verify that registration of External project is a baseline ..."

Gofer new
version: 'ConfigurationOfExternal-dkh.1';
version: 'ConfigurationOfExternalRef-dkh.1';
repository: externalRepository;
load.
Metacello new
configuration: 'ExternalRef';
repository: 'dictionary://Metacello_Configuration_Test_Repository';
get.
self
should: [
"Referencing a non-existent version in ConfigurationOfExternal"
Metacello new
configuration: 'ExternalRef';
version: '0.9.2';
repository: 'dictionary://Metacello_Configuration_Test_Repository';
load ]
raise: MetacelloProjectSpecLoadError
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@
"testDefaultVersionUpgradeIssue230" : "dkh 09/30/2014 14:24",
"testEnsureLoad" : "dkh 09/30/2014 14:25",
"testEnsureLoadIssue230" : "dkh 09/30/2014 14:27",
"testIssue331" : "dkh 02/19/2015 13:34" } }
"testIssue331A" : "dkh 02/19/2015 15:07",
"testIssue331B" : "dkh 02/19/2015 15:17",
"testIssue331C" : "dkh 02/19/2015 15:20",
"testIssue331D" : "dkh 02/19/2015 15:43" } }

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
baseline pragma - github reference
configurationExternalRef092: spec
<version: '0.9.2'>
spec
for: #'common'
do: [
spec blessing: #'version'.
spec
description: 'MetacelloScriptingResource>>configurationExternalRef092:'.
spec
project: 'External'
with: [
"ConfigurationOfExternal 0.9.2 should not exist"
spec
className: 'ConfigurationOfExternal';
version: '0.9.2';
repository: 'dictionary://Metacello_Configuration_Test_Repository' ] ]
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,6 @@ baseline pragma - github reference
setUpConfigurationExternalRef
"self reset"

| reference className definitionArray versionInfo |
reference := GoferVersionReference name: 'ConfigurationOfExternalRef-dkh.1'.
className := #'ConfigurationOfExternalRef'.
definitionArray := {(MCOrganizationDefinition
categories: (Array with: reference packageName asSymbol)).
(MCClassDefinition
name: className
superclassName: #'ConfigurationOf'
category: reference packageName
instVarNames: #()
comment: '').
(MCMethodDefinition
className: className asString
classIsMeta: false
selector: 'configurationExternalRef090:'
category: 'cat'
timeStamp: ''
source: (self class sourceCodeAt: #'configurationExternalRef090:') asString).
(MCMethodDefinition
className: className asString
classIsMeta: false
selector: 'configurationExternalRef091:'
category: 'cat'
timeStamp: ''
source: (self class sourceCodeAt: #'configurationExternalRef091:') asString)}.
externalRepository
basicStoreVersion:
(MCVersion new
setPackage: (MetacelloTestsMCPackage new name: reference packageName)
info:
(versionInfo := MCVersionInfo
name: reference name
id: UUID new
message: 'This is a mock version'
date: Date today
time: Time now
author: reference author
ancestors: #())
snapshot: (MCSnapshot fromDefinitions: definitionArray)
dependencies: #()).
^ versionInfo
| versionInfo |
versionInfo := self setUpConfigurationExternalRefdkh1.
versionInfo := self setUpConfigurationExternalRefdkh2: {versionInfo}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
baseline pragma - github reference
setUpConfigurationExternalRefdkh1
"self reset"

| reference className definitionArray versionInfo |
reference := GoferVersionReference name: 'ConfigurationOfExternalRef-dkh.1'.
className := #'ConfigurationOfExternalRef'.
definitionArray := {(MCOrganizationDefinition
categories: (Array with: reference packageName asSymbol)).
(MCClassDefinition
name: className
superclassName: #'ConfigurationOf'
category: reference packageName
instVarNames: #()
comment: '').
(MCMethodDefinition
className: className asString
classIsMeta: false
selector: 'configurationExternalRef090:'
category: 'cat'
timeStamp: ''
source: (self class sourceCodeAt: #'configurationExternalRef090:') asString).
(MCMethodDefinition
className: className asString
classIsMeta: false
selector: 'configurationExternalRef091:'
category: 'cat'
timeStamp: ''
source: (self class sourceCodeAt: #'configurationExternalRef091:') asString)}.
externalRepository
basicStoreVersion:
(MCVersion new
setPackage: (MetacelloTestsMCPackage new name: reference packageName)
info:
(versionInfo := MCVersionInfo
name: reference name
id: UUID new
message: 'This is a mock version'
date: Date today
time: Time now
author: reference author
ancestors: #())
snapshot: (MCSnapshot fromDefinitions: definitionArray)
dependencies: #()).
^ versionInfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
baseline pragma - github reference
setUpConfigurationExternalRefdkh2: ancestors
"self reset"

| reference className definitionArray versionInfo |
reference := GoferVersionReference name: 'ConfigurationOfExternalRef-dkh.2'.
className := #'ConfigurationOfExternalRef'.
definitionArray := {(MCOrganizationDefinition
categories: (Array with: reference packageName asSymbol)).
(MCClassDefinition
name: className
superclassName: #'ConfigurationOf'
category: reference packageName
instVarNames: #()
comment: '').
(MCMethodDefinition
className: className asString
classIsMeta: false
selector: 'configurationExternalRef090:'
category: 'cat'
timeStamp: ''
source: (self class sourceCodeAt: #'configurationExternalRef090:') asString).
(MCMethodDefinition
className: className asString
classIsMeta: false
selector: 'configurationExternalRef091:'
category: 'cat'
timeStamp: ''
source: (self class sourceCodeAt: #'configurationExternalRef091:') asString).
(MCMethodDefinition
className: className asString
classIsMeta: false
selector: 'configurationExternalRef092:'
category: 'cat'
timeStamp: ''
source: (self class sourceCodeAt: #'configurationExternalRef092:') asString)}.
externalRepository
basicStoreVersion:
(MCVersion new
setPackage: (MetacelloTestsMCPackage new name: reference packageName)
info:
(versionInfo := MCVersionInfo
name: reference name
id: UUID new
message: 'This is a mock version'
date: Date today
time: Time now
author: reference author
ancestors: ancestors)
snapshot: (MCSnapshot fromDefinitions: definitionArray)
dependencies: #()).
^ versionInfo
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"configuration098Issue215:" : "dkh 11/24/2013 20:22",
"configurationExternalRef090:" : "dkh 07/29/2013 07:47",
"configurationExternalRef091:" : "dkh 07/29/2013 07:47",
"configurationExternalRef092:" : "dkh 02/19/2015 15:35",
"configurationGithubReferenceIV:" : "dkh 6/22/2012 17:22",
"configurationGithubReferenceV:" : "dkh 6/22/2012 17:22",
"configurationGithubReferenceX:" : "dkh 6/22/2012 17:22",
Expand Down Expand Up @@ -80,7 +81,9 @@
"setUpBaselineOfExternalXXX" : "dkh 6/12/2012 15:41:23.319",
"setUpConfiguration181" : "dkh 11/24/2013 20:20",
"setUpConfiguration63" : "dkh 6/26/2012 16:45",
"setUpConfigurationExternalRef" : "dkh 07/29/2013 07:34",
"setUpConfigurationExternalRef" : "dkh 02/19/2015 15:16",
"setUpConfigurationExternalRefdkh1" : "dkh 02/19/2015 15:14",
"setUpConfigurationExternalRefdkh2:" : "dkh 02/19/2015 15:38",
"setUpConfigurationIssue32" : "dkh 6/18/2012 15:47",
"setUpConfigurationIssue59" : "dkh 6/22/2012 18:13",
"setUpConfigurationIssue84" : "dkh 7/24/2012 19:21",
Expand Down

Large diffs are not rendered by default.

0 comments on commit 2660326

Please sign in to comment.