Sha256: 401c005e4fa400d5eda4685c6b8de85f3ac8e8bd9cc35c48bbaff005471cb90f
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
require 'spec_helper' require 'tailor/lexer/token' describe Tailor::Lexer::Token do before do allow(Tailor::Logger).to receive(:log) end describe '#modifier_keyword?' do subject do options = { full_line_of_text: full_line_of_text } Tailor::Lexer::Token.new('if', options) end context 'the current line has a keyword that is also a modifier' do context 'the keyword is acting as a modifier' do let!(:full_line_of_text) { %(puts "hi" if true == true) } it 'returns true' do expect(subject.modifier_keyword?).to eq true end end context 'they keyword is NOT acting as a modifier' do let!(:full_line_of_text) { %(if true == true; puts "hi"; end) } it 'returns false' do expect(subject.modifier_keyword?).to eq false end end end context 'the current line does not have a keyword' do let!(:full_line_of_text) { %(puts true) } subject do options = { full_line_of_text: full_line_of_text } Tailor::Lexer::Token.new('puts', options) end it 'returns false' do expect(subject.modifier_keyword?).to eq false end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tailor-1.4.1 | spec/unit/tailor/lexer/token_spec.rb |