Sha256: 49c448672f460e6c0beeebfb5a7e60b06c414e33988bae46fa3de6ba86935d18
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
require 'test_helper' module Pelusa module Lint describe Properties do before do @lint = Properties.new end describe '#check' do describe 'when the class does not use getters, setters or properties' do it 'returns a SuccessAnalysis' do klass = Pelusa.to_ast """ class Foo def initialize @name = 'john' end def name @name end end""" analysis = @lint.check(klass) analysis.successful?.must_equal true end end describe 'when the class uses getters, setters or properties' do it 'returns a FailureAnalysis' do klass = Pelusa.to_ast """ class Foo attr_accessor :name attr_reader :foo end""" analysis = @lint.check(klass) analysis.failed?.must_equal true end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pelusa-0.2.4 | test/pelusa/lint/properties_test.rb |