|
160 | 160 | it { expect(regexp_node.interpolation?).to eq(false) }
|
161 | 161 | end
|
162 | 162 | end
|
| 163 | + |
| 164 | + describe '#multiline?' do |
| 165 | + context 'with no options' do |
| 166 | + let(:source) { '/x/' } |
| 167 | + |
| 168 | + it { expect(regexp_node.multiline?).to be(false) } |
| 169 | + end |
| 170 | + |
| 171 | + context 'with other options' do |
| 172 | + let(:source) { '/x/ix' } |
| 173 | + |
| 174 | + it { expect(regexp_node.multiline?).to be(false) } |
| 175 | + end |
| 176 | + |
| 177 | + context 'with only m option' do |
| 178 | + let(:source) { '/x/m' } |
| 179 | + |
| 180 | + it { expect(regexp_node.multiline?).to be(true) } |
| 181 | + end |
| 182 | + |
| 183 | + context 'with m and other options' do |
| 184 | + let(:source) { '/x/imx' } |
| 185 | + |
| 186 | + it { expect(regexp_node.multiline?).to be(true) } |
| 187 | + end |
| 188 | + end |
| 189 | + |
| 190 | + describe '#extended?' do |
| 191 | + context 'with no options' do |
| 192 | + let(:source) { '/x/' } |
| 193 | + |
| 194 | + it { expect(regexp_node.extended?).to be(false) } |
| 195 | + end |
| 196 | + |
| 197 | + context 'with other options' do |
| 198 | + let(:source) { '/x/im' } |
| 199 | + |
| 200 | + it { expect(regexp_node.extended?).to be(false) } |
| 201 | + end |
| 202 | + |
| 203 | + context 'with only x option' do |
| 204 | + let(:source) { '/x/x' } |
| 205 | + |
| 206 | + it { expect(regexp_node.extended?).to be(true) } |
| 207 | + end |
| 208 | + |
| 209 | + context 'with x and other options' do |
| 210 | + let(:source) { '/x/ixm' } |
| 211 | + |
| 212 | + it { expect(regexp_node.extended?).to be(true) } |
| 213 | + end |
| 214 | + end |
| 215 | + |
| 216 | + describe '#ignore_case?' do |
| 217 | + context 'with no options' do |
| 218 | + let(:source) { '/x/' } |
| 219 | + |
| 220 | + it { expect(regexp_node.ignore_case?).to be(false) } |
| 221 | + end |
| 222 | + |
| 223 | + context 'with other options' do |
| 224 | + let(:source) { '/x/xm' } |
| 225 | + |
| 226 | + it { expect(regexp_node.ignore_case?).to be(false) } |
| 227 | + end |
| 228 | + |
| 229 | + context 'with only i option' do |
| 230 | + let(:source) { '/x/i' } |
| 231 | + |
| 232 | + it { expect(regexp_node.ignore_case?).to be(true) } |
| 233 | + end |
| 234 | + |
| 235 | + context 'with i and other options' do |
| 236 | + let(:source) { '/x/xim' } |
| 237 | + |
| 238 | + it { expect(regexp_node.ignore_case?).to be(true) } |
| 239 | + end |
| 240 | + end |
| 241 | + |
| 242 | + describe '#no_encoding?' do |
| 243 | + context 'with no options' do |
| 244 | + let(:source) { '/x/' } |
| 245 | + |
| 246 | + it { expect(regexp_node.no_encoding?).to be(false) } |
| 247 | + end |
| 248 | + |
| 249 | + context 'with other options' do |
| 250 | + let(:source) { '/x/xm' } |
| 251 | + |
| 252 | + it { expect(regexp_node.no_encoding?).to be(false) } |
| 253 | + end |
| 254 | + |
| 255 | + context 'with only n option' do |
| 256 | + let(:source) { '/x/n' } |
| 257 | + |
| 258 | + it { expect(regexp_node.no_encoding?).to be(true) } |
| 259 | + end |
| 260 | + |
| 261 | + context 'with n and other options' do |
| 262 | + let(:source) { '/x/xnm' } |
| 263 | + |
| 264 | + it { expect(regexp_node.no_encoding?).to be(true) } |
| 265 | + end |
| 266 | + end |
| 267 | + |
| 268 | + describe '#single_interpolation?' do |
| 269 | + context 'with no options' do |
| 270 | + let(:source) { '/x/' } |
| 271 | + |
| 272 | + it { expect(regexp_node.single_interpolation?).to be(false) } |
| 273 | + end |
| 274 | + |
| 275 | + context 'with other options' do |
| 276 | + let(:source) { '/x/xm' } |
| 277 | + |
| 278 | + it { expect(regexp_node.single_interpolation?).to be(false) } |
| 279 | + end |
| 280 | + |
| 281 | + context 'with only o option' do |
| 282 | + let(:source) { '/x/o' } |
| 283 | + |
| 284 | + it { expect(regexp_node.single_interpolation?).to be(true) } |
| 285 | + end |
| 286 | + |
| 287 | + context 'with o and other options' do |
| 288 | + let(:source) { '/x/xom' } |
| 289 | + |
| 290 | + it { expect(regexp_node.single_interpolation?).to be(true) } |
| 291 | + end |
| 292 | + end |
163 | 293 | end
|
0 commit comments