Giter Club home page Giter Club logo

parserchallenge1's Introduction

ParserChallenge1

Skill Level: Beginner
Time Limit: 20-30 minutes

Installation

This challenge utilizes RSpec. You may have to install bundler.

  • gem install bundler
  • run bundle install when in the projects main folder "ParserChallenge1"
  • Run the tests with bundle exec rspec word_in_string_spec.rb -f d

Instructions

Does the word exist in the string? Write a method word_in_string? that will detect if a word is in a string. The details are in the documentation below.

The output of rspec is also the documentation:

word_in_string?
  returns symbols :yes and :no
    should return :no for word_in_string?('grow', 'growler')
    should return :yes for word_in_string?('grow', 'miracle grow')
  should detect whole words; e.g.:
    should detect 'book' in 'book_shelf'
    should detect 'book' in 'note_book_shelf'
    should detect 'book' in 'note_book'
    should detect 'book' in 'note_book-'
    should detect 'cat' in 'bodega-cat'
    should detect 'cat' in 'bodega cat'
  should not count words within words; e.g.:
    should not detect 'book' in 'bookshelf'
    should not detect 'book' in 'notebook'
    should not detect 'lap' in 'lapaz'
    should not detect 'apa' in 'lapaz'
    should not detect 'cat' in 'c a t'

Finished in 0.00269 seconds (files took 0.47919 seconds to load)
13 examples, 0 failures

Resources

parserchallenge1's People

Contributors

jaybobo avatar sjreich avatar mikegee avatar vpappu avatar cartoloupe avatar

Watchers

 avatar Jim Muir avatar Tirthankar Bhattacharjee avatar James Cloos avatar Larry Scott avatar Gopal Adhikari avatar  avatar Travis Sperry avatar Bryon Wilkins avatar  avatar MattD avatar Priya  avatar  avatar Travis Witherington avatar Jennifer Cable avatar L Pnag avatar  avatar Candace Foreman avatar Matthew Mohr avatar  avatar  avatar  avatar  avatar Jeff Spencer avatar  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.