Sha256: 9fcbd50131eccd48d265bad03dccac26e7d5314cc611328d20eb127ca95d6083

Contents?: true

Size: 895 Bytes

Versions: 3

Compression:

Stored size: 895 Bytes

Contents

# encoding: UTF-8

# We can just have a smoke test for this one since it's mostly using built-in
# Rails functionality. Plus the output is a bit different between Rails
# versions, so that's annoying.

require 'spec_helper'

describe "show-routes" do
  it "should print a list of routes" do
    output = mock_pry('show-routes', 'exit-all')

    output.must_match %r{^edit_pokemon GET    /pokemon/edit}
  end

  it "should print a list of routes which include grep option" do
    output = mock_pry('show-routes -G edit', 'exit-all')

    output.must_match %r{^edit_pokemon GET    /pokemon/edit}
    output.must_match %r{^   edit_beer GET    /beer/edit}
  end

  it "should filter list based on multiple grep options" do
    output = mock_pry('show-routes -G edit -G pokemon', 'exit-all')

    output.must_match %r{^edit_pokemon GET    /pokemon/edit}
    output.wont_match %r{edit_beer}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pry-rails-0.3.8 spec/show_routes_spec.rb
pry-rails-0.3.7 spec/show_routes_spec.rb
pry-rails-0.3.6 spec/show_routes_spec.rb