<commit_before>require 'spec_helper'
require 'xway/cli'
require 'xway/version'

describe Xway::Cli do
  let('parameter') do
    double('Xway::Parameter').tap { |o| o.stub('rest').and_return([]) }
  end
  let('api') { double('api') }
  let('out') { double('stdout').tap { |o| o.stub('puts') } }
  before { Xway.stub('parameter').and_return(parameter) }
  subject { described_class.new api, out }

  its('start') { should eq nil }

  it 'prints version per default' do
    out.should_receive('puts').with("xway #{Xway::VERSION}")
    subject.start
  end

  it 'executes commands using api' do
    api.should_receive('request').with('list').and_return('list result')
    out.should_receive('puts').with('list result')
    parameter.stub('rest').and_return(['list'])
    subject.start
  end

  it 'executes commands with custom app name' do
    pending 'not impl'
  end
end<commit_msg>Remove deprecated pending spec<commit_after>require 'spec_helper'
require 'xway/cli'
require 'xway/version'

describe Xway::Cli do
  let('parameter') do
    double('Xway::Parameter').tap { |o| o.stub('rest').and_return([]) }
  end
  let('api') { double('api') }
  let('out') { double('stdout').tap { |o| o.stub('puts') } }
  before { Xway.stub('parameter').and_return(parameter) }
  subject { described_class.new api, out }

  its('start') { should eq nil }

  it 'prints version per default' do
    out.should_receive('puts').with("xway #{Xway::VERSION}")
    subject.start
  end

  it 'executes commands using api' do
    api.should_receive('request').with('list').and_return('list result')
    out.should_receive('puts').with('list result')
    parameter.stub('rest').and_return(['list'])
    subject.start
  end
end
{'fraction_non_alphanumeric': 0.17411764705882352, 'fraction_numerical': 0.0, 'mean_word_length': 4.469453376205788, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2068533', 'n_tokens_mistral': 577, 'n_tokens_neox': 564, 'n_words': 124}