Sha256: 3a3eed7b5aee5daacf2a4f68bbccd72e2b6d8279e5bf7d4d27fb73f2e49a209e

Contents?: true

Size: 732 Bytes

Versions: 6

Compression:

Stored size: 732 Bytes

Contents

require 'test_helper'

class ScopeTest < Test::Unit::TestCase
  include Tins::Scope

  def test_default_scope
    scope_block(:foo) do
      assert_equal [ :foo ], scope
      scope_block(:bar) do
        assert_equal [ :foo, :bar ], scope
        scope.push :baz
        assert_equal [ :foo, :bar ], scope
      end
    end
  end

  def test_two_scopes
    scope_block(:foo, :my_scope) do
      assert_equal [ :foo ], scope(:my_scope)
      scope_block(:baz) do
        scope_block(:bar, :my_scope) do
          assert_equal [ :foo, :bar ], scope(:my_scope)
          scope.push(:baz, :my_scope)
          assert_equal [ :foo, :bar ], scope(:my_scope)
          assert_equal [ :baz ], scope
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tins-1.38.0 tests/scope_test.rb
tins-1.37.1 tests/scope_test.rb
tins-1.37.0 tests/scope_test.rb
tins-1.36.1 tests/scope_test.rb
tins-1.36.0 tests/scope_test.rb
tins-1.35.0 tests/scope_test.rb