File: nested_context_spec.rb

package info (click to toggle)
ruby-thor 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: ruby: 9,250; makefile: 8; sh: 1
file content (20 lines) | stat: -rw-r--r-- 423 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "helper"

describe Thor::NestedContext do
  subject(:context) { described_class.new }

  describe "#enter" do
    it "is never empty within the entered block" do
      context.enter do
        context.enter {}

        expect(context).to be_entered
      end
    end

    it "is empty when outside of all blocks" do
      context.enter { context.enter {} }
      expect(context).not_to be_entered
    end
  end
end