Sha256: 137b1e96c01167a27233a45fc31f3478d574d2947176cd42e7cf2f7666987fb7

Contents?: true

Size: 458 Bytes

Versions: 14

Compression:

Stored size: 458 Bytes

Contents

RSpec::Matchers.define :enclose_scope do |expected_scope|
  chain(:under) do |scope|
    @external_scope = scope
  end

  match do |actual|
    @result = true
    dsl(@external_scope || [:config]) do |c|
      @result &= !c.send(:current_scope?, expected_scope)
      c.send(expected_scope, :foo) do
        @result &= c.send(:current_scope?, expected_scope)
      end
      @result &= !c.send(:current_scope?, expected_scope)
    end
    @result
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
taketo-0.1.3 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.1.2 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.1.1 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.1.0 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.10 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.9 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.8 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.7 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.6 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.5 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.4 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.3 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.2 spec/support/matchers/enclose_scope_matcher.rb
taketo-0.0.1 spec/support/matchers/enclose_scope_matcher.rb