Sha256: fab60b423c9aa6f376f1061d2dda2577032daefef3dfd2743e2c936596b9c9ea

Contents?: true

Size: 800 Bytes

Versions: 20

Compression:

Stored size: 800 Bytes

Contents

require 'spec_helper'

describe Fasterer::FileTraverser do
  include FileHelper
  include_context 'isolated environment'

  describe 'exit status should be' do
    context 'success' do
      it 'when no files exist' do
        `#{fasterer_bin}`
        expect($CHILD_STATUS.exitstatus).to eq(0)
      end

      it 'when no files with offenses exist' do
        create_file('user.rb', '[].sample')
        `#{fasterer_bin}`
        expect($CHILD_STATUS.exitstatus).to eq(0)
      end
    end

    context 'fail' do
      it 'when file with offenses exists' do
        create_file('user.rb', '[].shuffle.first')
        `#{fasterer_bin}`
        expect($CHILD_STATUS.exitstatus).to eq(1)
      end
    end
  end

  def fasterer_bin
    File.expand_path('../../../../bin/fasterer', __FILE__)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fasterer-0.11.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.10.1 spec/lib/fasterer/cli_spec.rb
fasterer-0.10.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.9.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.8.3 spec/lib/fasterer/cli_spec.rb
fasterer-0.8.2 spec/lib/fasterer/cli_spec.rb
fasterer-0.8.1 spec/lib/fasterer/cli_spec.rb
fasterer-0.8.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.7.1 spec/lib/fasterer/cli_spec.rb
fasterer-0.7.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.6.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.5.1 spec/lib/fasterer/cli_spec.rb
fasterer-0.5.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.4.2 spec/lib/fasterer/cli_spec.rb
fasterer-0.4.1 spec/lib/fasterer/cli_spec.rb
fasterer-0.4.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.3.2 spec/lib/fasterer/cli_spec.rb
fasterer-0.3.1 spec/lib/fasterer/cli_spec.rb
fasterer-0.3.0 spec/lib/fasterer/cli_spec.rb
fasterer-0.2.1 spec/lib/fasterer/cli_spec.rb