Skip to content
Browse files

added haml support

  • Loading branch information...
1 parent 1e6e5b3 commit cadf500d9c41e7c7055a33783925ed94835f35d1 @mahnve mahnve committed with
Showing with 12 additions and 1 deletion.
  1. +2 −0 Support/lib/spec/mate/switch_command.rb
  2. +10 −1 Support/spec/spec/mate/switch_command_spec.rb
View
2 Support/lib/spec/mate/switch_command.rb
@@ -43,12 +43,14 @@ def twin(path)
end
path = path.gsub(/\.rb$/, "_spec.rb")
path = path.gsub(/\.erb$/, ".erb_spec.rb")
+ path = path.gsub(/\.haml$/, ".haml_spec.rb")
path = path.gsub(/\.rhtml$/, ".rhtml_spec.rb")
path = path.gsub(/\.rjs$/, ".rjs_spec.rb")
when 'spec' then
path = path.gsub(/\.rjs_spec\.rb$/, ".rjs")
path = path.gsub(/\.rhtml_spec\.rb$/, ".rhtml")
path = path.gsub(/\.erb_spec\.rb$/, ".erb")
+ path = path.gsub(/\.haml_spec\.rb$/, ".haml")
path = path.gsub(/_spec\.rb$/, ".rb")
if framework.rails? || framework.merb?
path = path.gsub(/\/spec\/lib\//, "/lib/")
View
11 Support/spec/spec/mate/switch_command_spec.rb
@@ -124,6 +124,11 @@ def twin(expected)
"/a/full/path/app/views/mooky/show.html.erb",
"/a/full/path/spec/views/mooky/show.html.erb_spec.rb"
]
+
+ expect_twins [
+ "/a/full/path/app/views/mooky/show.html.haml",
+ "/a/full/path/spec/views/mooky/show.html.haml_spec.rb"
+ ]
expect_twins [
"/a/full/path/app/views/mooky/show.rhtml",
@@ -157,9 +162,13 @@ def twin(expected)
"/a/full/path/spec/helpers/mooky_helper_spec.rb".should be_a("helper spec")
end
- it "should suggest view spec" do
+ it "should suggest view spec for erb" do
"/a/full/path/spec/views/mooky/show.html.erb_spec.rb".should be_a("view spec")
end
+
+ it "should suggest view spec for haml" do
+ "/a/full/path/spec/views/mooky/show.html.haml_spec.rb".should be_a("view spec")
+ end
it "should suggest an rjs view spec" do
"/a/full/path/spec/views/mooky/show.js.rjs_spec.rb".should be_a("view spec")

0 comments on commit cadf500

Please sign in to comment.
Something went wrong with that request. Please try again.