spec/languages_spec.rb in code_stats2-0.1.6 vs spec/languages_spec.rb in code_stats2-0.1.7
- old
+ new
@@ -3,11 +3,11 @@
shared_examples_for 'language' do
it "should strip comments" do
lang = CodeStats.parse @script, @extension
lang.code.should == <<-CODE
code_a
-code_b
+code_b
CODE
# lang.code.should_not include 'comment_a'
# lang.code.should_not include 'comment_a2'
# lang.code.should_not include 'comment_b'
# lang.code.should_not include 'comment_b2'
@@ -155,11 +155,11 @@
@extension = :haml
@script = <<-HAML
code_a
/ comment_a
/ comment_a2
-code_b
+code_b
HAML
end
end
describe "Erb" do
@@ -167,11 +167,11 @@
before do
@extension = :erb
@script = <<-ERB
code_a
-code_b
+code_b
ERB
end
end
describe "Rjs" do
@@ -179,11 +179,11 @@
before do
@extension = :rjs
@script = <<-RJS
code_a
-code_b
+code_b
RJS
end
end
describe "Php" do
@@ -215,7 +215,21 @@
code_a
# comment_a
# comment_a2
code_b # comment_b3
PYTHON
+ end
+end
+
+describe "Clojure" do
+ it_should_behave_like "language"
+
+ before do
+ @extension = :clj
+ @script = <<-CLOJURE
+code_a
+; comment_a
+; comment_a2
+code_b ; comment_b3
+CLOJURE
end
end
\ No newline at end of file