spec/languages_spec.rb in code_stats2-0.1.7 vs spec/languages_spec.rb in code_stats2-0.1.8

- old
+ new

@@ -27,11 +27,11 @@ /* * comment_a2 */ // comment_b // comment_b2 -code_b // comment_b3 +code_b// comment_b3 JAVA end end describe "JavaScript" do @@ -47,11 +47,11 @@ /* * comment_a2 */ // comment_b // comment_b2 -code_b // comment_b3 +code_b// comment_b3 JAVA_SCRIPT end it "removing comments should correctly change lines count" do script = <<-JAVA_SCRIPT @@ -87,11 +87,11 @@ @extension = :rb @script = <<-RUBY code_a # comment_a # comment_a2 -code_b # comment_b3 +code_b# comment_b3 RUBY end end describe "Cpp" do @@ -107,11 +107,11 @@ /* * comment_a2 */ // comment_b // comment_b2 -code_b // comment_b3 +code_b// comment_b3 CPP end end describe "CoffeeScript" do @@ -127,11 +127,11 @@ ### comment_a2 ### # comment_b # comment_b2 -code_b # comment_b3 +code_b# comment_b3 COFFEE_SCRIPT end end describe "Yaml" do @@ -141,11 +141,11 @@ @extension = :yml @script = <<-YAML code_a # comment_a # comment_a2 -code_b # comment_b3 +code_b# comment_b3 YAML end end describe "Haml" do @@ -199,11 +199,11 @@ /* * comment_a2 */ // comment_b // comment_b2 -code_b // comment_b3 +code_b// comment_b3 PHP end end describe "Python" do @@ -213,11 +213,11 @@ @extension = :py @script = <<-PYTHON code_a # comment_a # comment_a2 -code_b # comment_b3 +code_b# comment_b3 PYTHON end end describe "Clojure" do @@ -227,9 +227,48 @@ @extension = :clj @script = <<-CLOJURE code_a ; comment_a ; comment_a2 -code_b ; comment_b3 +code_b; comment_b3 CLOJURE + end +end + +describe "Scala" do + it_should_behave_like "language" + + before do + @extension = :scala + @script = <<-SCALA +code_a +/* +comment_a +*/ +/* + * comment_a2 + */ +// comment_b +// comment_b2 +code_b// comment_b3 +SCALA + end +end + +describe "Html" do + it_should_behave_like "language" + + before do + @extension = :html + @script = <<-HTML +code_a +<!-- +comment_a +--> +<!-- + comment_a2 +--> +code_b<!-- comment_b3 --> + +HTML end end \ No newline at end of file