Sha256: 92138ce3ef40484a4abb5436b4c237acf804401c50f46e4cb929f43d5b31ef2f
Contents?: true
Size: 1.09 KB
Versions: 2
Compression:
Stored size: 1.09 KB
Contents
require 'spec_helper' require 'tempfile' describe Mire::Output::Unused, class: :model do before do methods = { foo: { definitions: [ { class: 'Foo', method: 'bar', file: 'foo/bar.rb', line: '123' }, { class: 'Boo', method: 'bar', file: 'boo/bar.rb', line: '12' } ], invocations: [] } } allow(subject).to receive(:methods).and_return(methods) end it 'returns methods that are unused' do expect(subject.check).to match_array([ 'foo/bar.rb:123 Foo.bar', 'boo/bar.rb:12 Boo.bar' ]) end it 'ignores files when given in the configuration' do configuration = Tempfile.new('mire_configuration') configuration << { output: { unused: { excluded_files: [ 'boo/**/*' ] } } }.to_yaml configuration.close stub_const('Mire::Configuration::FILE', configuration.path) expect(subject.check).to eq(['foo/bar.rb:123 Foo.bar']) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mire-0.1.2 | spec/mire/output/unused_spec.rb |
mire-0.1.1 | spec/mire/output/unused_spec.rb |