Sha256: 119e3c6b0b9b661a3fcd79366c116f5e3bd453a830471653ba56af9171385d24

Contents?: true

Size: 748 Bytes

Versions: 8

Compression:

Stored size: 748 Bytes

Contents

require 'spec_helper'

describe Codeqa::Checkers::CheckRubySyntax do
  it_behaves_like 'a checker'

  it 'should check text files' do
    source = source_with
    expect(described_class.check?(source)).to be_truthy
    source = source_with('', 'zipped.zip')
    expect(described_class.check?(source)).to be_falsey
  end

  it 'should detect syntax errors' do
    source = source_with('class MyClass')
    checker = check_with(described_class, source)
    expect(checker).to be_error
    expect(checker.errors.details).to eq([[nil, 'Ruby syntax error']])
  end

  it 'should find not find if not there ' do
    source = source_with('class MyClass; end')
    checker = check_with(described_class, source)
    expect(checker).to be_success
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
codeqa-0.5.0 spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb
codeqa-0.4.2 spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb
codeqa-0.4.1 spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb
codeqa-0.4.0 spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb
codeqa-0.4.0.pre2 spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb
codeqa-0.4.0.pre spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb
codeqa-0.3.1 spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb
codeqa-0.3.0 spec/lib/codeqa/checkers/check_ruby_syntax_spec.rb