Sha256: 549f039464bd94bcaf2c23c7a697d1e939e57c10b6151c3e3a2588f475519181

Contents?: true

Size: 748 Bytes

Versions: 87

Compression:

Stored size: 748 Bytes

Contents

require 'helper'

class TestStaticEnvironment < Minitest::Test
  def setup
    @env = Parser::StaticEnvironment.new
  end

  def test_declare
    refute @env.declared?(:foo)

    @env.declare :foo

    assert @env.declared?(:foo)
  end

  def test_extend_static
    @env.declare :foo
    @env.extend_static
    @env.declare :bar

    refute @env.declared?(:foo)
    assert @env.declared?(:bar)
  end

  def test_extend_dynamic
    @env.declare :foo
    @env.extend_dynamic
    @env.declare :bar

    assert @env.declared?(:foo)
    assert @env.declared?(:bar)
  end

  def test_unextend
    @env.declare :foo
    @env.extend_dynamic
    @env.declare :bar
    @env.unextend

    assert @env.declared?(:foo)
    refute @env.declared?(:bar)
  end
end

Version data entries

87 entries across 87 versions & 5 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/parser-2.4.0.2/test/test_static_environment.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/parser-2.4.0.2/test/test_static_environment.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/test/test_static_environment.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/test/test_static_environment.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/test/test_static_environment.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/test/test_static_environment.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.0/test/test_static_environment.rb
parser-2.4.0.2 test/test_static_environment.rb
parser-2.4.0.1 test/test_static_environment.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/parser-2.4.0.0/test/test_static_environment.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/parser-2.4.0.0/test/test_static_environment.rb
parser-2.4.0.0 test/test_static_environment.rb
parser-2.3.3.1 test/test_static_environment.rb
parser-2.3.3.0 test/test_static_environment.rb
parser-2.3.2.0 test/test_static_environment.rb
parser-2.3.1.4 test/test_static_environment.rb
parser-2.3.1.3 test/test_static_environment.rb
erruby_parser-2.3.1.2 test/test_static_environment.rb
parser-2.3.1.2 test/test_static_environment.rb
parser-2.3.1.1 test/test_static_environment.rb