Sha256: 37b7ceadb40785cf7eadcaf5e7af768c6f260aa89d55122b73c2c18bb3c93581

Contents?: true

Size: 932 Bytes

Versions: 3

Compression:

Stored size: 932 Bytes

Contents

require 'spec_helper'

BIN = 'bin/gem-search'
USAGE = <<-EOS
Usage: gem-search gem_name [options]

    -s, --sort         Sort by the item.
                        [n]ame :default  eg. gem-search webkit
                        [v]er  :DL(ver)  eg. gem-search webkit -s v
                        [a]ll  :DL(all)  eg. gem-search webkit -s a
    -v, --version      Display the version.
    -h, --help         Display this help message.
EOS


shared_examples 'display an usage' do
  it 'should display an usage' do
    should == USAGE
  end
end

describe 'bin/gem-search' do
  context 'with no argument' do
    subject { `#{BIN}` }
    it_behaves_like 'display an usage'
  end

  context 'with -h' do
    subject { `#{BIN} -h` }
    it_behaves_like 'display an usage'
  end

  context 'with -v' do
    subject { `#{BIN} -v` }
    it 'should display an usage' do
      should == "gem-search #{Gem::Search::VERSION}\n"
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gem-search-0.0.8 spec/bin/gem-search_spec.rb
gem-search-0.0.7 spec/bin/gem-search_spec.rb
gem-search-0.0.6 spec/bin/gem-search_spec.rb