@@ -769,6 +769,69 @@ public void should_format_scenario_with_a_step_with_a_doc_string() throws Throwa
769
769
assertPrettyJsonEquals (expected , formatterOutput );
770
770
}
771
771
772
+ @ Test
773
+ public void should_format_scenario_with_a_step_with_a_doc_string_and_content_type () throws Throwable {
774
+ CucumberFeature feature = TestHelper .feature ("path/test.feature" , "" +
775
+ "Feature: Banana party\n " +
776
+ "\n " +
777
+ " Scenario: Monkey eats bananas\n " +
778
+ " Given there are bananas\n " +
779
+ " \" \" \" doc\n " +
780
+ " doc string content\n " +
781
+ " \" \" \" \n " );
782
+ Map <String , Result > stepsToResult = new HashMap <String , Result >();
783
+ stepsToResult .put ("there are bananas" , result ("passed" ));
784
+ Map <String , String > stepsToLocation = new HashMap <String , String >();
785
+ stepsToLocation .put ("there are bananas" , "StepDefs.there_are_bananas()" );
786
+ Long stepDuration = milliSeconds (1 );
787
+
788
+ String formatterOutput = runFeatureWithJSONPrettyFormatter (feature , stepsToResult , stepsToLocation , stepDuration );
789
+
790
+ String expected = "" +
791
+ "[\n " +
792
+ " {\n " +
793
+ " \" id\" : \" banana-party\" ,\n " +
794
+ " \" uri\" : \" path/test.feature\" ,\n " +
795
+ " \" keyword\" : \" Feature\" ,\n " +
796
+ " \" name\" : \" Banana party\" ,\n " +
797
+ " \" line\" : 1,\n " +
798
+ " \" description\" : \" \" ,\n " +
799
+ " \" elements\" : [\n " +
800
+ " {\n " +
801
+ " \" id\" : \" banana-party;monkey-eats-bananas\" ,\n " +
802
+ " \" keyword\" : \" Scenario\" ,\n " +
803
+ " \" name\" : \" Monkey eats bananas\" ,\n " +
804
+ " \" line\" : 3,\n " +
805
+ " \" description\" : \" \" ,\n " +
806
+ " \" type\" : \" scenario\" ,\n " +
807
+ " \" steps\" : [\n " +
808
+ " {\n " +
809
+ " \" keyword\" : \" Given \" ,\n " +
810
+ " \" name\" : \" there are bananas\" ,\n " +
811
+ " \" line\" : 4,\n " +
812
+ " \" doc_string\" : {\n " +
813
+ " \" content_type\" : \" doc\" ,\n " +
814
+ " \" value\" : \" doc string content\" ,\n " +
815
+ " \" line\" : 5\n " +
816
+ " },\n " +
817
+ " \" match\" : {\n " +
818
+ " \" location\" : \" StepDefs.there_are_bananas()\" \n " +
819
+ " },\n " +
820
+ " \" result\" : {\n " +
821
+ " \" status\" : \" passed\" ,\n " +
822
+ " \" duration\" : 1000000\n " +
823
+ " }\n " +
824
+ " }\n " +
825
+ " ]\n " +
826
+ " }\n " +
827
+ " ],\n " +
828
+ " \" tags\" : []\n " +
829
+ " }\n " +
830
+ "]" ;
831
+ assertPrettyJsonEquals (expected , formatterOutput );
832
+ }
833
+
834
+
772
835
@ Test
773
836
public void should_format_scenario_with_a_step_with_a_data_table () throws Throwable {
774
837
CucumberFeature feature = TestHelper .feature ("path/test.feature" , "" +
0 commit comments