@@ -71,13 +71,13 @@ public void shouldBePossible_toReadSpec_fromInputStream() throws IOException {
7171
7272 @ Test
7373 public void shouldBePossible_toReadSpec_fromFile () throws IOException {
74- PageSpec pageSpec = new PageSpecReader (NO_BROWSER ).read (new File ( getClass ().getResource ("/specs.txt" ).getFile () ));
74+ PageSpec pageSpec = new PageSpecReader (NO_BROWSER ).read (getClass ().getResource ("/specs.txt" ).getFile ());
7575 assertThat (pageSpec , is (notNullValue ()));
7676 }
7777
7878 @ Test
7979 public void shouldLoadSpecSuccessfully () throws IOException {
80- pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/specs.txt" ).getFile () ));
80+ pageSpec = pageSpecReader .read (getClass ().getResource ("/specs.txt" ).getFile ());
8181 assertThat (pageSpec , is (notNullValue ()));
8282 }
8383
@@ -120,7 +120,7 @@ public void shouldRead_allSpecs_asSections_markedByTags() {
120120
121121 @ Test
122122 public void shouldAlways_provideAsteriskTags_whenFiltering_byIncludedTags () throws IOException {
123- PageSpec pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/specs/spec-asterisk-tags.spec" ).getFile () ));
123+ PageSpec pageSpec = pageSpecReader .read (getClass ().getResource ("/specs/spec-asterisk-tags.spec" ).getFile ());
124124
125125 assertThat ("Total amount of sections should be" , pageSpec .getSections ().size (), is (3 ));
126126
@@ -351,7 +351,7 @@ public void givesError_ifThereAre_tabsIndentations() throws Exception {
351351
352352 @ Test
353353 public void shouldImport_otherSpecs_fromOtherFiles () throws Exception {
354- PageSpec pageSpec = pageSpecReader .read (new File ( getClass (). getResource ( "/spec-import-test/main.spec" ). getFile ()) );
354+ PageSpec pageSpec = pageSpecReader .read ("/spec-import-test/main.spec" );
355355
356356 assertThat (pageSpec .getObjects (), hasKey ("content" ));
357357 assertThat (pageSpec .getObjects (), hasKey ("header" ));
@@ -378,7 +378,7 @@ public void shouldImport_otherSpecs_fromOtherFiles() throws Exception {
378378
379379 @ Test
380380 public void shouldProcess_simpleMathOperations_inParameterizedSpecs () throws IOException {
381- PageSpec pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/spec-math.spec" ).getFile () ));
381+ PageSpec pageSpec = pageSpecReader .read (getClass ().getResource ("/spec-math.spec" ).getFile ());
382382
383383 List <Spec > specs = pageSpec .getSections ().get (0 ).getObjects ().get (0 ).getSpecs ();
384384
@@ -390,7 +390,7 @@ public void shouldProcess_simpleMathOperations_inParameterizedSpecs() throws IOE
390390
391391 @ Test
392392 public void shouldParse_conditionalSpecBlocks () throws Exception {
393- PageSpec pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/specs/spec-conditional-simple.spec" ).getFile () ));
393+ PageSpec pageSpec = pageSpecReader .read (getClass ().getResource ("/specs/spec-conditional-simple.spec" ).getFile ());
394394
395395 List <PageSection > sections = pageSpec .getSections ();
396396 assertThat (sections .size (), is (1 ));
@@ -429,7 +429,7 @@ public void shouldParse_conditionalSpecBlocks() throws Exception {
429429
430430 @ Test
431431 public void shouldParse_conditionalSpecBlocks_withOrStatement () throws Exception {
432- PageSpec pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/specs/spec-conditional-or.spec" ).getFile () ));
432+ PageSpec pageSpec = pageSpecReader .read (getClass ().getResource ("/specs/spec-conditional-or.spec" ).getFile ());
433433
434434 List <PageSection > sections = pageSpec .getSections ();
435435 assertThat (sections .size (), is (1 ));
@@ -479,7 +479,7 @@ public void shouldParse_conditionalSpecBlocks_withOrStatement() throws Exception
479479
480480 @ Test
481481 public void shouldParse_conditionalSpecBlocks_inverted () throws Exception {
482- PageSpec pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/specs/spec-conditional-inverted.spec" ).getFile () ));
482+ PageSpec pageSpec = pageSpecReader .read (getClass ().getResource ("/specs/spec-conditional-inverted.spec" ).getFile ());
483483
484484 List <PageSection > sections = pageSpec .getSections ();
485485 assertThat (sections .size (), is (1 ));
@@ -521,7 +521,7 @@ public void shouldParse_conditionalSpecBlocks_inverted() throws Exception {
521521
522522 @ Test
523523 public void shouldParse_conditionalSpecBlocks_withOtherwise () throws Exception {
524- PageSpec pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/specs/spec-conditional-otherwise.spec" ).getFile () ));
524+ PageSpec pageSpec = pageSpecReader .read (getClass ().getResource ("/specs/spec-conditional-otherwise.spec" ).getFile ());
525525
526526 List <PageSection > sections = pageSpec .getSections ();
527527 assertThat (sections .size (), is (1 ));
@@ -558,7 +558,7 @@ public void shouldParse_conditionalSpecBlocks_withOtherwise() throws Exception {
558558
559559 @ Test
560560 public void shouldParse_componentSpecs () throws Exception {
561- PageSpec pageSpec = pageSpecReader .read (new File ( getClass ().getResource ("/specs/components/spec-for-component-test-main.spec" ).getFile () ));
561+ PageSpec pageSpec = pageSpecReader .read (getClass ().getResource ("/specs/components/spec-for-component-test-main.spec" ).getFile ());
562562 List <PageSection > sections = pageSpec .getSections ();
563563 assertThat (sections .size (), is (1 ));
564564
@@ -590,7 +590,7 @@ private void assertChildComponentSpec(List<Spec> specs) {
590590
591591 private FileSyntaxException expectExceptionFromReading (String file ) throws IOException {
592592 try {
593- pageSpecReader .read (new File ( getClass ().getResource (file ).getFile () ));
593+ pageSpecReader .read (getClass ().getResource (file ).getFile ());
594594 }
595595 catch (FileSyntaxException exception ) {
596596 return exception ;
0 commit comments