@@ -213,6 +213,51 @@ public function it_parses_the_readme_example()
213
213
], $ this ->subject ->parse ($ blueprint ));
214
214
}
215
215
216
+ /**
217
+ * @test
218
+ */
219
+ public function it_parses_the_readme_example_with_different_platform_eols ()
220
+ {
221
+ $ definition = $ this ->fixture ('definitions/readme-example.bp ' );
222
+
223
+ $ LF = "\n" ;
224
+ $ CR = "\r" ;
225
+ $ CRLF = "\r\n" ;
226
+
227
+ $ definition_mac_eol = str_replace ($ LF , $ CR , $ definition );
228
+ $ definition_windows_eol = str_replace ($ LF , $ CRLF , $ definition );
229
+
230
+ $ expected = [
231
+ 'models ' => [
232
+ 'Post ' => [
233
+ 'title ' => 'string:400 ' ,
234
+ 'content ' => 'longtext ' ,
235
+ 'published_at ' => 'nullable timestamp ' ,
236
+ ],
237
+ ],
238
+ 'controllers ' => [
239
+ 'Post ' => [
240
+ 'index ' => [
241
+ 'query ' => 'all:posts ' ,
242
+ 'render ' => 'post.index with:posts ' ,
243
+ ],
244
+ 'store ' => [
245
+ 'validate ' => 'title, content ' ,
246
+ 'save ' => 'post ' ,
247
+ 'send ' => 'ReviewNotification to:post.author with:post ' ,
248
+ 'dispatch ' => 'SyncMedia with:post ' ,
249
+ 'fire ' => 'NewPost with:post ' ,
250
+ 'flash ' => 'post.title ' ,
251
+ 'redirect ' => 'post.index ' ,
252
+ ],
253
+ ],
254
+ ],
255
+ ];
256
+
257
+ $ this ->assertEquals ($ expected , $ this ->subject ->parse ($ definition_mac_eol ));
258
+ $ this ->assertEquals ($ expected , $ this ->subject ->parse ($ definition_windows_eol ));
259
+ }
260
+
216
261
/**
217
262
* @test
218
263
*/
0 commit comments