Sha256: 433b78fceebb53c4645d4eca62a17b72b0978d14abd6e6ee0b16ae058d727e1d

Contents?: true

Size: 536 Bytes

Versions: 24

Compression:

Stored size: 536 Bytes

Contents

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

if defined?(Ripper)
  describe Temple::Filters::StaticAnalyzer do
    before do
      @filter = Temple::Filters::StaticAnalyzer.new
    end

    it 'should convert :dynamic to :static if code is static' do
      @filter.call([:dynamic, '"#{"hello"}#{100}"']
      ).should.equal [:static, 'hello100']
    end

    it 'should not convert :dynamic if code is dynamic' do
      exp = [:dynamic, '"#{hello}#{100}"']
      @filter.call(exp).should.equal(exp)
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
brakeman-4.3.1 bundle/ruby/2.5.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.7.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.7.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.6.2 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.6.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.6.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.5.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.4.1 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.4.0 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.3.5 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb
brakeman-3.3.4 bundle/ruby/2.3.0/gems/temple-0.7.7/test/filters/test_static_analyzer.rb