@@ -57,94 +57,6 @@ describe('embark.Config', function () {
5757 } ) ;
5858 } ) ;
5959
60- describe ( '#getExternalContractUrl' , function ( ) {
61- it ( 'should get the right url for a https://github file' , function ( ) {
62- const fileObj = config . getExternalContractUrl (
63- { file : 'https://github.com/embark-framework/embark/blob/master/test_app/app/contracts/simple_storage.sol' }
64- ) ;
65- assert . deepEqual ( fileObj ,
66- {
67- filePath : 'embark-framework/embark/master/test_app/app/contracts/simple_storage.sol' ,
68- url : 'https://raw.githubusercontent.com/embark-framework/embark/master/test_app/app/contracts/simple_storage.sol'
69- } ) ;
70- } ) ;
71-
72- it ( 'should fail for a malformed https://github file' , function ( ) {
73- const fileObj = config . getExternalContractUrl (
74- { file : 'https://github/embark-framework/embark/blob/master/test_app/app/contracts/simple_storage.sol' }
75- ) ;
76- assert . strictEqual ( fileObj , null ) ;
77- } ) ;
78-
79- it ( 'should get the right url for a git:// file with no branch #' , function ( ) {
80- const fileObj = config . getExternalContractUrl (
81- { file : 'git://github.com/status-im/contracts/contracts/identity/ERC725.sol' }
82- ) ;
83- assert . deepEqual ( fileObj ,
84- {
85- filePath : 'status-im/contracts/master/contracts/identity/ERC725.sol' ,
86- url : 'https://raw.githubusercontent.com/status-im/contracts/master/contracts/identity/ERC725.sol'
87- } ) ;
88- } ) ;
89-
90- it ( 'should get the right url for a git:// file with a branch #' , function ( ) {
91- const fileObj = config . getExternalContractUrl (
92- { file : 'git://github.com/status-im/contracts/contracts/identity/ERC725.sol#myBranch' }
93- ) ;
94- assert . deepEqual ( fileObj ,
95- {
96- filePath : 'status-im/contracts/myBranch/contracts/identity/ERC725.sol' ,
97- url : 'https://raw.githubusercontent.com/status-im/contracts/myBranch/contracts/identity/ERC725.sol'
98- } ) ;
99- } ) ;
100-
101- it ( 'should fail when the git:// file is malformed' , function ( ) {
102- const fileObj = config . getExternalContractUrl (
103- { file : 'git://github.com/identity/ERC725.sol#myBranch' }
104- ) ;
105- assert . strictEqual ( fileObj , null ) ;
106- } ) ;
107-
108- it ( 'should get the right url with a github.com file without branch #' , function ( ) {
109- const fileObj = config . getExternalContractUrl (
110- { file : 'github.com/status-im/contracts/contracts/identity/ERC725.sol' }
111- ) ;
112- assert . deepEqual ( fileObj ,
113- {
114- filePath : 'status-im/contracts/master/contracts/identity/ERC725.sol' ,
115- url : 'https://raw.githubusercontent.com/status-im/contracts/master/contracts/identity/ERC725.sol'
116- } ) ;
117- } ) ;
118-
119- it ( 'should get the right url with a github.com file with branch #' , function ( ) {
120- const fileObj = config . getExternalContractUrl (
121- { file : 'github.com/status-im/contracts/contracts/identity/ERC725.sol#theBranch' }
122- ) ;
123- assert . deepEqual ( fileObj ,
124- {
125- filePath : 'status-im/contracts/theBranch/contracts/identity/ERC725.sol' ,
126- url : 'https://raw.githubusercontent.com/status-im/contracts/theBranch/contracts/identity/ERC725.sol'
127- } ) ;
128- } ) ;
129-
130- it ( 'should fail with a malformed github.com url' , function ( ) {
131- const fileObj = config . getExternalContractUrl (
132- { file : 'github/status-im/contracts/contracts/identity/ERC725.sol#theBranch' }
133- ) ;
134- assert . strictEqual ( fileObj , null ) ;
135- } ) ;
136-
137- it ( 'should succeed with a generic http url' , function ( ) {
138- const fileObj = config . getExternalContractUrl (
139- { file : 'http://myurl.com/myFile.sol' }
140- ) ;
141- assert . deepEqual ( fileObj , {
142- filePath : 'myFile.sol' ,
143- url : 'http://myurl.com/myFile.sol'
144- } ) ;
145- } ) ;
146- } ) ;
147-
14860 describe ( '#loadExternalContractsFiles' , function ( ) {
14961 it ( 'should create the right list of files and download' , function ( ) {
15062 config . contractsFiles = [ ] ;
0 commit comments