Permalink
Browse files

Added first feature for printing the version number

  • Loading branch information...
1 parent 75677fc commit d9a9854accc8bf8a1a16cf380e9f9ad408a1486a @brynary committed Feb 3, 2009
Showing with 43 additions and 0 deletions.
  1. +1 −0 cucumber.yml
  2. +11 −0 features/cli.feature
  3. +7 −0 features/step_definitions/testjour_steps.rb
  4. +9 −0 features/support/env.rb
  5. +6 −0 lib/testjour.rb
  6. +9 −0 lib/testjour/cli.rb
View
1 cucumber.yml
@@ -0,0 +1 @@
+default: --format pretty features
View
11 features/cli.feature
@@ -0,0 +1,11 @@
+Feature: testjour CLI
+
+ In order to write software quicker
+ As a software engineer
+ I want to run my Cucumber features in parallel
+
+ Scenario: Print version information
+
+ When I run testjour --version
+ Then it should pass with "testjour 0.3"
+
View
7 features/step_definitions/testjour_steps.rb
@@ -0,0 +1,7 @@
+When /^I run testjour \-\-version$/ do
+ Testjour::CLI.new(["--version"], @stdout = StringIO.new, @stderr = StringIO.new)
+end
+
+Then /^it should pass with "testjour 0\.3"$/ do
+ @stdout.string.should be_like("testjour 0.3")
+end
View
9 features/support/env.rb
@@ -0,0 +1,9 @@
+require File.expand_path(File.dirname(__FILE__) + "/../../lib/testjour")
+
+require 'spec/expectations'
+
+def be_like(expected)
+ simple_matcher "should be like #{expected.inspect}" do |actual|
+ actual.strip == expected.strip
+ end
+end
View
6 lib/testjour.rb
@@ -0,0 +1,6 @@
+$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
+
+require "testjour/cli"
+
+module Testjour
+end
View
9 lib/testjour/cli.rb
@@ -0,0 +1,9 @@
+module Testjour
+ class CLI
+
+ def initialize(args, out_stream = STDOUT, error_stream = STDERR)
+ out_stream.puts "testjour 0.3"
+ end
+
+ end
+end

0 comments on commit d9a9854

Please sign in to comment.