Sha256: 32dc21e559da385b658813ba82ba2ba7481ca0e787a2125251a374eccda697aa

Contents?: true

Size: 1019 Bytes

Versions: 1

Compression:

Stored size: 1019 Bytes

Contents

require 'spec_helper'
describe "viiite commands" do

  Dir[File.expand_path('../**/*.cmd', __FILE__)].each do |input|
    cmd = File.read(input).chomp

    specify "#{File.basename(input)}: #{cmd}" do
      argv = Quickl.parse_commandline_args(cmd)[1..-1]
      stdout = File.join(File.dirname(input), "#{File.basename(input, ".cmd")}.stdout")
      stderr = File.join(File.dirname(input), "#{File.basename(input, ".cmd")}.stderr")
      stdout_expected = File.exists?(stdout) ? File.read(stdout) : ""
      stderr_expected = File.exists?(stderr) ? File.read(stderr) : ""

      cmd.should match /^viiite /
      cache = File.join(fixtures_folder, "saved")
      out, err = capture_io do
        begin
          Viiite::Command.run(["--suite=#{fixtures_folder}/bdb", "--cache=#{cache}"] + argv)
        rescue SystemExit
          puts "SystemExit"
        end
      end

      out.should eq stdout_expected unless RUBY_VERSION < "1.9"
      err.should eq stderr_expected unless RUBY_VERSION < "1.9"
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
viiite-0.2.0 spec/integration/test_command.rb