Sha256: dcee635924c585255475535a9876a295560d8d1e0e2bfb886fdaae52bea7d654
Contents?: true
Size: 858 Bytes
Versions: 15
Compression:
Stored size: 858 Bytes
Contents
require 'test_helper' require_relative '../lib/sandi_meter/loc_checker' describe SandiMeter::LOCChecker do let(:checker) { SandiMeter::LOCChecker.new([]) } describe '#check' do context 'for short code' do before do stub_const('SandiMeter::LOCChecker::MAX_LOC', { 'blah' => 10 }) checker.stub(:locs_size).and_return(rand(0..10)) end # REFACTOR # avoid passing dumb arguments to tested methods it 'passes the check' do checker.check([1,2,3], 'blah').should be_true end end context 'for large code' do before do stub_const('SandiMeter::LOCChecker::MAX_LOC', { 'blah' => 10 }) checker.stub(:locs_size).and_return(rand(11..100)) end it 'does not pass the check' do checker.check([1,2,3], 'blah').should be_false end end end end
Version data entries
15 entries across 15 versions & 1 rubygems