Permalink
Browse files

Spec for --line_number option.

  • Loading branch information...
1 parent c336282 commit 5748a0b9d6fbafd3125f7e701fd352eec6f28cab @justinko justinko committed Jun 25, 2012
Showing with 39 additions and 0 deletions.
  1. +39 −0 spec/integration/command_line/line_number_spec.rb
@@ -0,0 +1,39 @@
+require 'spec_helper'
+
+describe 'command line' do
+ describe '--line_number' do
+ before :all do
+ write_file 'spec/example_spec.rb', """
+ describe 9 do
+ it 'should be > 8' do
+ 9.should be > 8
+ end
+
+ it 'should be < 10' do
+ 9.should be < 10
+ end
+
+ it 'should be 3 squared' do
+ 9.should be 3*3
+ end
+
+ it { should be > 7 }
+ it { should be < 11 }
+ end
+ """
+ end
+
+ it 'works when specified multiple times' do
+ run_command 'tmp/aruba/spec/example_spec.rb --line_number 2 --line_number 6 --format doc'
+ stdout.string.should include('should be > 8')
+ stdout.string.should include('should be < 10')
+ stdout.string.should_not include('should be 3*3')
+ end
+
+ it 'works for one-liners' do
+ run_command 'tmp/aruba/spec/example_spec.rb --line_number 15 --format doc'
+ stdout.string.should include('example at ./tmp/aruba/spec/example_spec.rb:15')
+ stdout.string.should_not include('example at ./tmp/aruba/spec/example_spec.rb:16')
+ end
+ end
+end

0 comments on commit 5748a0b

Please sign in to comment.