Permalink
Browse files

Added specs for path and file line extracting methods [Issue #57]

  • Loading branch information...
1 parent c1f3f24 commit a0957cb45fb841a5b4932241ee699ee96be177dc @voxik committed Jul 5, 2010
Showing with 19 additions and 0 deletions.
  1. +19 −0 spec/rspec/core/formatters/base_formatter_spec.rb
@@ -55,4 +55,23 @@
end
end
+ describe "extract_file_path" do
+ it "extracts file path from backtrace line in *nix" do
+ formatter.__send__(:extract_file_path, "/path/file.html.erb_spec.rb:14:in `block (2 levels) in <top (required)>'").should == "/path/file.html.erb_spec.rb"
+ end
+
+ it "extracts file path from backtrace line in Windows" do
+ formatter.__send__(:extract_file_path, "C:/path/file.html.erb_spec.rb:14:in `block (2 levels) in <top (required)>'").should == "C:/path/file.html.erb_spec.rb"
+ end
+ end
+
+ describe "extract_line_number" do
+ it "extract line number from backtrace line in *nix" do
+ formatter.__send__(:extract_line_number, "/path/file.html.erb_spec.rb:14:in `block (2 levels) in <top (required)>'").should == "14"
+ end
+
+ it "extract line number from backtrace line in Windows" do
+ formatter.__send__(:extract_line_number, "C:/path/file.html.erb_spec.rb:14:in `block (2 levels) in <top (required)>'").should == "14"
+ end
+ end
end

0 comments on commit a0957cb

Please sign in to comment.