Sha256: f4028d8a0a7217a81edc5db8000a6b523434fe62cb77256ce79075e48f543827

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

# -*- coding: utf-8 -*-
require File.expand_path( File.join(File.dirname(__FILE__), "..", "..", "spec_helper") )

describe CommandQuery do

  before do
    @certified_output_dirname = File.join( TEST_DIR, "certified_output" )
  end

  it "should accept -h (help) option" do
    out = with_stdout_captured do
      args = %w{query -h}
      CliDirCat.new.parse_and_execute(args)
    end
    out.should match /Usage:/
  end

  it "should show catalogs info" do
    cat_filename = File.join( @certified_output_dirname, "dircat1.yaml" )
    out = with_stdout_captured do
      args = "query #{cat_filename}"
      CliDirCat.new.parse_and_execute(args.split)
    end
    out.should match /file: 2/
    out.should match /Bytes: 4/
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dircat-0.1.8 spec/dircat/cli/command_query_spec.rb
dircat-0.1.7 spec/dircat/cli/command_query_spec.rb
dircat-0.1.6 spec/dircat/cli/command_query_spec.rb