Permalink
Browse files

Add simple spec for -x command line arg.

  • Loading branch information...
1 parent 454d09f commit 27107ef52058a0d017a16ed897b55a0325c78c87 @headius headius committed Jun 22, 2011
Showing with 15 additions and 0 deletions.
  1. +12 −0 command_line/dash_x_spec.rb
  2. +3 −0 command_line/fixtures/embedded_ruby.txt
@@ -0,0 +1,12 @@
+describe "The -x command line option" do
+ before :each do
+ @file = fixture __FILE__, "embedded_ruby.txt"
+ end
+
+ it "runs code after the first /\#!.*ruby.*/-ish line in target file" do
+ result = `#{RUBY_EXE} -x #{@file}`
+ result.should == "success\n"
+ end
+
+ it "needs to be reviewed for spec completeness"
+end
@@ -0,0 +1,3 @@
+@@@This line is not value Ruby
+#!ruby
+puts 'success'

0 comments on commit 27107ef

Please sign in to comment.