Sha256: aeefb72c70ab3105d1e865aab3e987d30c3d232381c3aee757d69c47ca87a8fd

Contents?: true

Size: 779 Bytes

Versions: 6

Compression:

Stored size: 779 Bytes

Contents

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

describe Roodi::Checks::ModuleNameCheck do
  before(:each) do
    @roodi = Roodi::Core::ParseTreeRunner.new(Roodi::Checks::ModuleNameCheck.new)
  end
  
  it "should accept camel case module names starting in capitals" do
    content = <<-END
    module GoodModuleName 
    end
    END
    @roodi.check_content(content)
    @roodi.errors.should be_empty
  end

  it "should reject module names with underscores" do
    content = <<-END
    module Bad_ModuleName 
    end
    END
    @roodi.check_content(content)
    errors = @roodi.errors
    errors.should_not be_empty
    errors[0].to_s.should eql("dummy-file.rb:1 - Module name \"Bad_ModuleName\" should match pattern /^[A-Z][a-zA-Z0-9]*$/")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
roodi-1.3.2 spec/roodi/checks/module_name_check_spec.rb
roodi-1.3.4 spec/roodi/checks/module_name_check_spec.rb
roodi-1.3.6 spec/roodi/checks/module_name_check_spec.rb
roodi-1.3.3 spec/roodi/checks/module_name_check_spec.rb
roodi-1.3.7 spec/roodi/checks/module_name_check_spec.rb
roodi-1.3.5 spec/roodi/checks/module_name_check_spec.rb