GithubHelp home page GithubHelp logo

nickpwhite / ruby-command-line Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vanilla-project/ruby-command-line

0.0 0.0 0.0 2 KB

Vanilla Ruby Command Line Project

Home Page: https://vanilla-project.guide/ruby/command-line

License: MIT License

Ruby 100.00%

ruby-command-line's Introduction

Vanilla Ruby Command Line Project

This repository shows a basic setup for a command line application in Ruby.

Getting Started

Ruby and Bundler is expected to be installed on our system.

Installing

After cloning this repository, change into the newly created directory and run

bundle install

This will install all dependencies needed for the project.

Running the Tests

All tests can be run by executing

bundle exec rspec

rspec will automatically find all tests inside the spec directory and run them.

Testing Approach

The test for class Example is only verifying the return value of one method.

Main on the other hand is tested via a test-double that gets injected. This allows us to spy on the output of it. We want to avoid printing anything to the screen while running the tests. Injecting a test double in this instance is a nice way to isolate our application from the command line.

In the executable bin/example we inject $stdout, which is Ruby's variable for its standard output.

Running the Application

To run the application execute bin/example. You should see the text “Ruby Example” being printed.

$: ./bin/example
Ruby Example

Built With

License

This project is licensed under the MIT License - see the license.md file for details.

ruby-command-line's People

Contributors

christophgockel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.