Sha256: f8a1a4c6e38eec90d71b84ed72afd2217555fe8371117d52beb39da396c2274d

Contents?: true

Size: 649 Bytes

Versions: 9

Compression:

Stored size: 649 Bytes

Contents

require 'helper'
begin
  require 'ripper'
rescue LoadError
end

if defined?(Ripper) && RUBY_VERSION >= "2.0.0"
  describe Temple::Filters::StringSplitter do
    before do
      @filter = Temple::Filters::StringSplitter.new
    end

    it 'should split :dynamic with string literal' do
      @filter.call([:dynamic, '"static#{dynamic}"']
      ).should.equal [:multi, [:static, 'static'], [:dynamic, 'dynamic']]
    end

    describe '.compile' do
      it 'should raise CompileError for non-string literals' do
        lambda { Temple::Filters::StringSplitter.compile('1') }.
          should.raise(Temple::FilterError)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 4 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/test/filters/test_string_splitter.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/test/filters/test_string_splitter.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/temple-0.8.2/test/filters/test_string_splitter.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/temple-0.8.2/test/filters/test_string_splitter.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/temple-0.8.2/test/filters/test_string_splitter.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/temple-0.8.0/test/filters/test_string_splitter.rb
temple-0.8.2 test/filters/test_string_splitter.rb
temple-0.8.1 test/filters/test_string_splitter.rb
temple-0.8.0 test/filters/test_string_splitter.rb