Sha256: ba65ad0986c08eea88720816befdd0088b57d418242e8974ec9b5ae47459c0de

Contents?: true

Size: 681 Bytes

Versions: 2

Compression:

Stored size: 681 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Simplabs::Excellent::Checks::ClassVariableCheck do

  before(:each) do
    @excellent = Simplabs::Excellent::Core::ParseTreeRunner.new(Simplabs::Excellent::Checks::ClassVariableCheck.new)
  end

  describe '#evaluate' do

    it 'should reject class variables' do
      content = <<-END
        @@foo
      END
      @excellent.check_content(content)
      errors = @excellent.errors

      errors.should_not be_empty
      errors[0].info.should        == { :variable => :@@foo }
      errors[0].line_number.should == 1
      errors[0].message.should     == 'Class variable @@foo.'
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simplabs-excellent-1.0.0 spec/checks/class_variable_check_spec.rb
simplabs-excellent-1.0.1 spec/checks/class_variable_check_spec.rb