From daa0925016a63dcde448643cbf1310aca359cf37 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Wed, 13 May 2015 01:40:11 +0200 Subject: Rename MarkdownHelper to MarkupHelper --- spec/lib/gitlab/gitlab_markdown_helper_spec.rb | 40 -------------------------- spec/lib/gitlab/markup_helper_spec.rb | 40 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 spec/lib/gitlab/gitlab_markdown_helper_spec.rb create mode 100644 spec/lib/gitlab/markup_helper_spec.rb (limited to 'spec/lib') diff --git a/spec/lib/gitlab/gitlab_markdown_helper_spec.rb b/spec/lib/gitlab/gitlab_markdown_helper_spec.rb deleted file mode 100644 index beaafd56352..00000000000 --- a/spec/lib/gitlab/gitlab_markdown_helper_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require 'spec_helper' - -describe Gitlab::MarkdownHelper do - describe '#markup?' do - %w(textile rdoc org creole wiki - mediawiki rst adoc ad asciidoc).each do |type| - it "returns true for #{type} files" do - expect(Gitlab::MarkdownHelper.markup?("README.#{type}")).to be_truthy - end - end - - it 'returns false when given a non-markup filename' do - expect(Gitlab::MarkdownHelper.markup?('README.rb')).not_to be_truthy - end - end - - describe '#gitlab_markdown?' do - %w(mdown md markdown).each do |type| - it "returns true for #{type} files" do - expect(Gitlab::MarkdownHelper.gitlab_markdown?("README.#{type}")).to be_truthy - end - end - - it 'returns false when given a non-markdown filename' do - expect(Gitlab::MarkdownHelper.gitlab_markdown?('README.rb')).not_to be_truthy - end - end - - describe '#asciidoc?' do - %w(adoc ad asciidoc ADOC).each do |type| - it "returns true for #{type} files" do - expect(Gitlab::MarkdownHelper.asciidoc?("README.#{type}")).to be_truthy - end - end - - it 'returns false when given a non-asciidoc filename' do - expect(Gitlab::MarkdownHelper.asciidoc?('README.rb')).not_to be_truthy - end - end -end diff --git a/spec/lib/gitlab/markup_helper_spec.rb b/spec/lib/gitlab/markup_helper_spec.rb new file mode 100644 index 00000000000..448beecf01f --- /dev/null +++ b/spec/lib/gitlab/markup_helper_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe Gitlab::MarkupHelper do + describe '#markup?' do + %w(textile rdoc org creole wiki + mediawiki rst adoc ad asciidoc).each do |type| + it "returns true for #{type} files" do + expect(Gitlab::MarkupHelper.markup?("README.#{type}")).to be_truthy + end + end + + it 'returns false when given a non-markup filename' do + expect(Gitlab::MarkupHelper.markup?('README.rb')).not_to be_truthy + end + end + + describe '#gitlab_markdown?' do + %w(mdown md markdown).each do |type| + it "returns true for #{type} files" do + expect(Gitlab::MarkupHelper.gitlab_markdown?("README.#{type}")).to be_truthy + end + end + + it 'returns false when given a non-markdown filename' do + expect(Gitlab::MarkupHelper.gitlab_markdown?('README.rb')).not_to be_truthy + end + end + + describe '#asciidoc?' do + %w(adoc ad asciidoc ADOC).each do |type| + it "returns true for #{type} files" do + expect(Gitlab::MarkupHelper.asciidoc?("README.#{type}")).to be_truthy + end + end + + it 'returns false when given a non-asciidoc filename' do + expect(Gitlab::MarkupHelper.asciidoc?('README.rb')).not_to be_truthy + end + end +end -- cgit v1.2.1