2

I'm teaching myself the basics of how to make my own Ruby Gem using Bundler's guide. However when I get to setting up CLI tests with aruba/cucumber I keep running into a problem:

Command "co2domain" not found in PATH-variable "C:/.../PATH variables". (Aruba::LaunchError)

The only differences I made is to change some of the names of the example as I'd eventually like to build a gem that converts company names to their proper domains.

Here is my company.feature file:

Feature: Company
  In order to portray Company
  As a CLI
  I want to be as objective as possible

  Scenario: Positive number
    When I run `co2domain portray --num 2`
    Then the output should contain "positive"

  Scenario: Negative number
    When I run `co2domain portray --num -22`
    Then the output should contain "negative"

This is my company.rb file:

module Co2domain
  class Company
    def self.portray(num)
      if num > 0
        "positive"
      else
        "negative"
      end
    end
  end
end

As I am a beginner and the guide is for beginners I feel like I'm missing something small but important. Help appreciated.

RedOster
  • 325
  • 3
  • 16

1 Answers1

0

The error you are seeing is equivalent to the sh: foodie: command not found error found in the guide you are using. The difference is you are using a windows machine, and the guide is using a *nix machine.

The cucumber tests are testing running a command from the shell, and the shell is not able to find the command to run. If you add the directory your program is in to your PATH, or move your program to a directory in your path, cucumber should be able to run it.

Puhlze
  • 2,634
  • 18
  • 16