Sha256: 7ef14e373a4182ac02e82007e71164e58c9b5cdb9efc5bf1ceda39bfed927700
Contents?: true
Size: 751 Bytes
Versions: 11
Compression:
Stored size: 751 Bytes
Contents
RSpec.describe Mutant::AST::Meta::Send, '#receiver_possible_top_level_const?' do subject { described_class.new(node).receiver_possible_top_level_const? } def parse(source) Parser::CurrentRuby.parse(source) end context 'when implicit top level const' do let(:node) { parse('Foo.bar') } it { should be true } end context 'when cbase' do let(:node) { parse('::Foo.bar') } it { should be true } end context 'when nested const' do let(:node) { parse('Baz::Foo.bar') } it { should be false } end context 'when no receiver' do let(:node) { parse('bar') } it { should be false } end context 'when send receiver' do let(:node) { parse('foo.bar') } it { should be false } end end
Version data entries
11 entries across 11 versions & 1 rubygems