Sha256: 3d6b6ac474dca7a699f230ead29f634753b5ad40658b87bc2528c66182cd3793
Contents?: true
Size: 1.67 KB
Versions: 7
Compression:
Stored size: 1.67 KB
Contents
# frozen_string_literal: true require 'spec_helper' module RailsBestPractices::Core describe Check::Exceptable do let(:method) { Method.new 'BlogPost', 'approve', 'public', {} } context 'wildcard class and method' do let(:except_method) { '*#*' } it 'matches' do expect(described_class.matches(method, except_method)).to eql true end end context 'wildcard class and matching explicit method' do let(:except_method) { '*#approve' } it 'matches' do expect(described_class.matches(method, except_method)).to eql true end end context 'wildcard class and non-matching explicit method' do let(:except_method) { '*#disapprove' } it 'matches' do expect(described_class.matches(method, except_method)).to eql false end end context 'matching class and wildcard method' do let(:except_method) { 'BlogPost#*' } it 'matches' do expect(described_class.matches(method, except_method)).to eql true end end context 'non-matching class and wildcard method' do let(:except_method) { 'User#*' } it 'matches' do expect(described_class.matches(method, except_method)).to eql false end end context 'matching class and matching method' do let(:except_method) { 'BlogPost#approve' } it 'matches' do expect(described_class.matches(method, except_method)).to eql true end end context 'non-matching class and non-matching method' do let(:except_method) { 'User#disapprove' } it 'matches' do expect(described_class.matches(method, except_method)).to eql false end end end end
Version data entries
7 entries across 7 versions & 1 rubygems