Permalink
Browse files

Adding test to make sure we can parse ERB format if trimming dash is …

…used
  • Loading branch information...
1 parent 3874756 commit 5cbe0fcf591a00625a712cc18b6870cfeaeb7845 @hron84 hron84 committed Mar 27, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 spec/rspec/core/configuration_options_spec.rb
@@ -378,6 +378,18 @@
expect(parse_options[:formatters]).to eq([['local']])
end
+ it "parses options file correctly if erb code has trimming options" do
+ File.open("./.rspec", "w") do |f|
+ f << "<% if 1 == 1 -%>\n"
+ f << "--format local\n"
+ f << "<%- end %>\n"
+ end
+
+ expect do
+ expect(parse_options[:formatters]).to eq([['local']])
+ end.to_not raise_error(SyntaxError)
+ end
+
context "with custom options file" do
it "ignores project and global options files" do
File.open("./.rspec", "w") {|f| f << "--format project"}

0 comments on commit 5cbe0fc

Please sign in to comment.