listen 2.7.6 → 2.7.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.rspec +0 -0
  4. data/.rubocop.yml +0 -0
  5. data/.travis.yml +0 -0
  6. data/.yardopts +0 -0
  7. data/CHANGELOG.md +0 -0
  8. data/CONTRIBUTING.md +0 -0
  9. data/Gemfile +2 -0
  10. data/Guardfile +2 -0
  11. data/LICENSE.txt +0 -0
  12. data/README.md +0 -0
  13. data/Rakefile +0 -0
  14. data/lib/listen.rb +0 -0
  15. data/lib/listen/adapter.rb +0 -0
  16. data/lib/listen/adapter/base.rb +47 -21
  17. data/lib/listen/adapter/bsd.rb +31 -25
  18. data/lib/listen/adapter/darwin.rb +13 -12
  19. data/lib/listen/adapter/linux.rb +45 -36
  20. data/lib/listen/adapter/polling.rb +12 -7
  21. data/lib/listen/adapter/tcp.rb +9 -4
  22. data/lib/listen/adapter/windows.rb +46 -58
  23. data/lib/listen/change.rb +12 -8
  24. data/lib/listen/cli.rb +0 -0
  25. data/lib/listen/directory.rb +30 -22
  26. data/lib/listen/file.rb +9 -8
  27. data/lib/listen/listener.rb +35 -12
  28. data/lib/listen/options.rb +23 -0
  29. data/lib/listen/queue_optimizer.rb +23 -13
  30. data/lib/listen/record.rb +98 -21
  31. data/lib/listen/silencer.rb +21 -40
  32. data/lib/listen/tcp.rb +0 -0
  33. data/lib/listen/tcp/broadcaster.rb +0 -0
  34. data/lib/listen/tcp/message.rb +0 -0
  35. data/lib/listen/version.rb +1 -1
  36. data/listen.gemspec +0 -0
  37. data/spec/acceptance/listen_spec.rb +0 -0
  38. data/spec/acceptance/tcp_spec.rb +0 -0
  39. data/spec/lib/listen/adapter/base_spec.rb +17 -16
  40. data/spec/lib/listen/adapter/bsd_spec.rb +0 -0
  41. data/spec/lib/listen/adapter/darwin_spec.rb +11 -4
  42. data/spec/lib/listen/adapter/linux_spec.rb +20 -29
  43. data/spec/lib/listen/adapter/polling_spec.rb +15 -13
  44. data/spec/lib/listen/adapter/tcp_spec.rb +6 -3
  45. data/spec/lib/listen/adapter/windows_spec.rb +0 -0
  46. data/spec/lib/listen/adapter_spec.rb +0 -0
  47. data/spec/lib/listen/change_spec.rb +21 -27
  48. data/spec/lib/listen/directory_spec.rb +60 -42
  49. data/spec/lib/listen/file_spec.rb +16 -20
  50. data/spec/lib/listen/listener_spec.rb +136 -99
  51. data/spec/lib/listen/record_spec.rb +205 -62
  52. data/spec/lib/listen/silencer_spec.rb +44 -114
  53. data/spec/lib/listen/tcp/broadcaster_spec.rb +0 -0
  54. data/spec/lib/listen/tcp/listener_spec.rb +8 -5
  55. data/spec/lib/listen/tcp/message_spec.rb +0 -0
  56. data/spec/lib/listen_spec.rb +0 -0
  57. data/spec/spec_helper.rb +0 -0
  58. data/spec/support/acceptance_helper.rb +15 -4
  59. data/spec/support/fixtures_helper.rb +0 -0
  60. data/spec/support/platform_helper.rb +0 -0
  61. metadata +3 -2
@@ -1,28 +1,27 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Listen::Adapter::Polling do
3
+ include Listen
4
+
5
+ describe Adapter::Polling do
4
6
  describe 'class' do
5
7
  subject { described_class }
6
8
  it { should be_local_fs }
7
9
  it { should be_usable }
8
10
  end
9
11
 
10
- subject { described_class.new(listener) }
12
+ subject do
13
+ described_class.new(options.merge(mq: mq, directories: directories))
14
+ end
11
15
 
12
16
  let(:options) { {} }
13
- let(:listener) { instance_double(Listen::Listener, options: options) }
14
- let(:worker) { instance_double(Listen::Change) }
15
-
16
- before { allow(listener).to receive(:async).with(:change_pool) { worker } }
17
+ let(:mq) { instance_double(Listener, options: options) }
17
18
 
18
19
  describe '#start' do
19
- before { allow(listener).to receive(:directories) { ['directory_path'] } }
20
+ let(:directories) { [Pathname.pwd] }
20
21
 
21
22
  it 'notifies change on every listener directories path' do
22
- expect(worker).to receive(:change).with(
23
- :dir,
24
- 'directory_path',
25
- recursive: true)
23
+ expect(mq).to receive(:_queue_raw_change).
24
+ with(:dir, Pathname.pwd, '.', recursive: true)
26
25
 
27
26
  t = Thread.new { subject.start }
28
27
  sleep 0.25
@@ -31,10 +30,13 @@ describe Listen::Adapter::Polling do
31
30
  end
32
31
 
33
32
  describe '#_latency' do
34
- subject { described_class.new(listener).send(:_latency) }
33
+ subject do
34
+ adapter = described_class.new(options.merge(mq: mq, directories: []))
35
+ adapter.options.latency
36
+ end
35
37
 
36
38
  context 'with no overriding option' do
37
- it { should eq described_class.const_get('DEFAULT_POLLING_LATENCY') }
39
+ it { should eq 1.0 }
38
40
  end
39
41
 
40
42
  context 'with custom latency overriding' do
@@ -5,7 +5,9 @@ describe Listen::Adapter::TCP do
5
5
  let(:host) { '10.0.0.2' }
6
6
  let(:port) { 4000 }
7
7
 
8
- subject { described_class.new(listener) }
8
+ let(:options) { { host: host, port: port } }
9
+
10
+ subject { described_class.new(options.merge(mq: listener)) }
9
11
  let(:registry) { instance_double(Celluloid::Registry) }
10
12
 
11
13
  let(:listener) do
@@ -111,11 +113,12 @@ describe Listen::Adapter::TCP do
111
113
  end
112
114
 
113
115
  describe '#handle_message' do
116
+ let(:dir) { Pathname.pwd }
114
117
  it 'notifies listener of path changes' do
115
- message = Listen::TCP::Message.new('file', 'modified', '/foo', {})
118
+ message = Listen::TCP::Message.new('file', 'modified', dir, 'foo', {})
116
119
 
117
120
  expect(subject.wrapped_object).
118
- to receive(:_notify_change).with :file, '/foo', change: :modified
121
+ to receive(:_queue_change).with :file, dir, 'foo', change: :modified
119
122
 
120
123
  subject.handle_message message
121
124
  end
File without changes
File without changes
@@ -4,11 +4,15 @@ describe Listen::Change do
4
4
  let(:subject) { Listen::Change.new(listener) }
5
5
  let(:listener) { instance_double(Listen::Listener, options: {}) }
6
6
  let(:record) { instance_double(Listen::Record) }
7
- let(:file_path) { Pathname.new('file_path') }
7
+ let(:full_file_path) { instance_double(Pathname, to_s: '/dir/file.rb') }
8
+ let(:full_dir_path) { instance_double(Pathname, to_s: '/dir') }
9
+ let(:dir) { instance_double(Pathname) }
8
10
 
9
11
  before do
10
12
  allow(listener).to receive(:sync).with(:record) { record }
11
13
  allow(listener).to receive(:async).with(:change_pool) { subject }
14
+ allow(dir).to receive(:+).with('file.rb') { full_file_path }
15
+ allow(dir).to receive(:+).with('dir1') { full_dir_path }
12
16
  end
13
17
 
14
18
  describe '#change' do
@@ -16,48 +20,43 @@ describe Listen::Change do
16
20
  before { allow(listener).to receive(:silencer) { silencer } }
17
21
 
18
22
  context 'with build options' do
19
- let(:async_record) do
20
- instance_double(Listen::Record, still_building!: nil)
21
- end
22
-
23
- it 'calls update_last_build_time on record' do
23
+ it 'calls still_building! on record' do
24
24
  allow(listener).to receive(:queue)
25
25
  allow(record).to receive(:async) { async_record }
26
- expect(async_record).to receive(:unset_path)
27
- subject.change(:file, file_path, build: true)
26
+ allow(Listen::File).to receive(:change)
27
+ subject.change(:file, dir, 'file.rb', build: true)
28
28
  end
29
29
  end
30
30
 
31
31
  context 'file' do
32
32
  context 'with known change' do
33
- let(:file_path) { Pathname('file_path') }
34
33
  it 'notifies change directly to listener' do
35
34
  expect(listener).to receive(:queue).
36
- with(:file, :modified, file_path, {})
35
+ with(:file, :modified, dir, 'file.rb', {})
37
36
 
38
- subject.change(:file, file_path, change: :modified)
37
+ subject.change(:file, dir, 'file.rb', change: :modified)
39
38
  end
40
39
 
41
40
  it "doesn't notify to listener if path is silenced" do
42
41
  expect(silencer).to receive(:silenced?).and_return(true)
43
42
  expect(listener).to_not receive(:queue)
44
- subject.change(:file, file_path, change: :modified)
43
+ subject.change(:file, dir, 'file.rb', change: :modified)
45
44
  end
46
45
  end
47
46
 
48
47
  context 'with unknown change' do
49
48
 
50
49
  it 'calls Listen::File#change' do
51
- expect(Listen::File).to receive(:change).with(record, file_path)
52
- subject.change(:file, file_path)
50
+ expect(Listen::File).to receive(:change).with(record, dir, 'file.rb')
51
+ subject.change(:file, dir, 'file.rb')
53
52
  end
54
53
 
55
54
  it "doesn't call Listen::File#change if path is silenced" do
56
55
  expect(silencer).to receive(:silenced?).
57
- with(file_path, :file).and_return(true)
56
+ with(Pathname('file.rb'), :file).and_return(true)
58
57
 
59
58
  expect(Listen::File).to_not receive(:change)
60
- subject.change(:file, file_path)
59
+ subject.change(:file, dir, 'file.rb')
61
60
  end
62
61
 
63
62
  context 'that returns a change' do
@@ -65,20 +64,16 @@ describe Listen::Change do
65
64
 
66
65
  context 'listener listen' do
67
66
  it 'notifies change to listener' do
68
- file_path = instance_double(Pathname,
69
- to_s: 'file_path',
70
- exist?: true)
71
-
72
67
  expect(listener).to receive(:queue).
73
- with(:file, :modified, file_path)
68
+ with(:file, :modified, dir, 'file.rb')
74
69
 
75
- subject.change(:file, file_path)
70
+ subject.change(:file, dir, 'file.rb')
76
71
  end
77
72
 
78
73
  context 'silence option' do
79
74
  it 'notifies change to listener' do
80
75
  expect(listener).to_not receive(:queue)
81
- subject.change(:file, file_path, silence: true)
76
+ subject.change(:file, dir, 'file.rb', silence: true)
82
77
  end
83
78
  end
84
79
  end
@@ -89,7 +84,7 @@ describe Listen::Change do
89
84
 
90
85
  it "doesn't notifies no change" do
91
86
  expect(listener).to_not receive(:queue)
92
- subject.change(:file, file_path)
87
+ subject.change(:file, dir, 'file.rb')
93
88
  end
94
89
  end
95
90
  end
@@ -97,13 +92,12 @@ describe Listen::Change do
97
92
 
98
93
  context 'directory' do
99
94
  let(:dir_options) { { recursive: true } }
100
- let(:dir_path) { Pathname.new('dir_path') }
101
95
 
102
96
  it 'calls Listen::Directory#new' do
103
97
  expect(Listen::Directory).to receive(:scan).
104
- with(subject, record, dir_path, dir_options)
98
+ with(subject, record, dir, 'dir1', dir_options)
105
99
 
106
- subject.change(:dir, dir_path, dir_options)
100
+ subject.change(:dir, dir, 'dir1', dir_options)
107
101
  end
108
102
  end
109
103
  end
@@ -3,60 +3,68 @@ require 'spec_helper'
3
3
  include Listen
4
4
 
5
5
  describe Directory do
6
- let(:path) { Pathname.pwd }
7
- let(:dir) { path + 'dir' }
8
- let(:file) { dir + 'file.rb' }
9
- let(:file2) { dir + 'file2.rb' }
10
- let(:subdir) { dir + 'subdir' }
11
- let(:subdir2) { instance_double(Pathname, directory?: true) }
6
+ let(:dir) { double(:dir) }
7
+ let(:file) { double(:file, directory?: false) }
8
+ let(:file2) { double(:file2, directory?: false) }
9
+ let(:subdir) { double(:subdir, directory?: true) }
12
10
 
13
11
  let(:queue) { instance_double(Change, change: nil) }
14
12
 
15
13
  let(:async_record) do
16
- instance_double(Record, set_path: true, unset_path: true)
14
+ instance_double(Record, add_dir: true, unset_path: true)
17
15
  end
18
16
 
19
17
  let(:record) do
20
18
  instance_double(Record, async: async_record, dir_entries: record_entries)
21
19
  end
22
20
 
21
+ before do
22
+ allow(dir).to receive(:+).with('.') { dir }
23
+ allow(dir).to receive(:+).with('file.rb') { file }
24
+ allow(dir).to receive(:+).with('subdir') { subdir }
25
+
26
+ allow(file).to receive(:relative_path_from).with(dir) { 'file.rb' }
27
+ allow(file2).to receive(:relative_path_from).with(dir) { 'file2.rb' }
28
+ allow(subdir).to receive(:relative_path_from).with(dir) { 'subdir' }
29
+ end
30
+
23
31
  context '#scan with recursive off' do
24
32
  let(:options) { { recursive: false } }
25
33
 
26
34
  context 'with file & subdir in record' do
27
35
  let(:record_entries) do
28
- { 'file.rb' => { type: :file }, 'subdir' => { type: :dir } }
36
+ { 'file.rb' => { mtime: 1.1 }, 'subdir' => {} }
29
37
  end
30
38
 
31
39
  context 'with empty dir' do
32
40
  before { allow(dir).to receive(:children) { [] } }
33
41
 
34
42
  it 'sets record dir path' do
35
- expect(async_record).to receive(:set_path).with(:dir, dir)
36
- described_class.scan(queue, record, dir, options)
43
+ expect(async_record).to receive(:add_dir).with(dir, '.')
44
+ described_class.scan(queue, record, dir, '.', options)
37
45
  end
38
46
 
39
47
  it "queues changes for file path and dir that doesn't exist" do
40
- expect(queue).to receive(:change).with(:file, file)
48
+ expect(queue).to receive(:change).with(:file, dir, 'file.rb')
41
49
 
42
50
  expect(queue).to receive(:change).
43
- with(:dir, subdir, recursive: false)
51
+ with(:dir, dir, 'subdir', recursive: false)
44
52
 
45
- described_class.scan(queue, record, dir, options)
53
+ described_class.scan(queue, record, dir, '.', options)
46
54
  end
47
55
  end
48
56
 
49
- context 'with file2.rb in dir' do
57
+ context 'with only file2.rb in dir' do
50
58
  before { allow(dir).to receive(:children) { [file2] } }
51
59
 
52
60
  it 'notices file & file2 and no longer existing dir' do
53
- expect(queue).to receive(:change).with(:file, file)
54
- expect(queue).to receive(:change).with(:file, file2)
61
+ expect(queue).to receive(:change).with(:file, dir, 'file.rb')
62
+ expect(queue).to receive(:change).with(:file, dir, 'file2.rb')
55
63
 
56
64
  expect(queue).to receive(:change).
57
- with(:dir, subdir, recursive: false)
65
+ with(:dir, dir, 'subdir', recursive: false)
58
66
 
59
- described_class.scan(queue, record, dir, options)
67
+ described_class.scan(queue, record, dir, '.', options)
60
68
  end
61
69
  end
62
70
  end
@@ -69,12 +77,12 @@ describe Directory do
69
77
 
70
78
  it 'reports no changes' do
71
79
  expect(queue).to_not receive(:change)
72
- described_class.scan(queue, record, dir, options)
80
+ described_class.scan(queue, record, dir, '.', options)
73
81
  end
74
82
 
75
83
  it 'unsets record dir path' do
76
- expect(async_record).to receive(:unset_path).with(dir)
77
- described_class.scan(queue, record, dir, options)
84
+ expect(async_record).to receive(:unset_path).with(dir, '.')
85
+ described_class.scan(queue, record, dir, '.', options)
78
86
  end
79
87
  end
80
88
 
@@ -82,13 +90,13 @@ describe Directory do
82
90
  before { allow(dir).to receive(:children) { [file] } }
83
91
 
84
92
  it 'queues changes for file & file2 paths' do
85
- expect(queue).to receive(:change).with(:file, file)
86
- expect(queue).to_not receive(:change).with(:file, file2)
93
+ expect(queue).to receive(:change).with(:file, dir, 'file.rb')
94
+ expect(queue).to_not receive(:change).with(:file, dir, 'file2.rb')
87
95
 
88
96
  expect(queue).to_not receive(:change).
89
- with(:dir, subdir, recursive: false)
97
+ with(:dir, dir, 'subdir', recursive: false)
90
98
 
91
- described_class.scan(queue, record, dir, options)
99
+ described_class.scan(queue, record, dir, '.', options)
92
100
  end
93
101
  end
94
102
  end
@@ -99,38 +107,42 @@ describe Directory do
99
107
 
100
108
  context 'with file.rb & subdir in record' do
101
109
  let(:record_entries) do
102
- { 'file.rb' => { type: :file }, 'subdir' => { type: :dir } }
110
+ { 'file.rb' => { mtime: 1.1 }, 'subdir' => {} }
103
111
  end
104
112
 
105
113
  context 'with empty dir' do
106
- before { allow(dir).to receive(:children) { [] } }
114
+ before do
115
+ allow(dir).to receive(:children) { [] }
116
+ end
107
117
 
108
118
  it 'queues changes for file & subdir path' do
109
- expect(queue).to receive(:change).with(:file, file)
119
+ expect(queue).to receive(:change).with(:file, dir, 'file.rb')
110
120
 
111
121
  expect(queue).to receive(:change).
112
- with(:dir, subdir, recursive: true)
122
+ with(:dir, dir, 'subdir', recursive: true)
113
123
 
114
- described_class.scan(queue, record, dir, options)
124
+ described_class.scan(queue, record, dir, '.', options)
115
125
  end
116
126
  end
117
127
 
118
128
  context 'with subdir2 path present in dir' do
129
+ let(:subdir2) { double(:subdir2, directory?: true, children: []) }
130
+
119
131
  before do
120
- allow(path).to receive(:children) { [dir] }
121
132
  allow(dir).to receive(:children) { [subdir2] }
133
+ allow(subdir2).to receive(:relative_path_from).with(dir) { 'subdir2' }
122
134
  end
123
135
 
124
136
  it 'queues changes for file, file2 & subdir paths' do
125
- expect(queue).to receive(:change).with(:file, file)
137
+ expect(queue).to receive(:change).with(:file, dir, 'file.rb')
126
138
 
127
139
  expect(queue).to receive(:change).
128
- with(:dir, subdir, recursive: true)
140
+ with(:dir, dir, 'subdir', recursive: true)
129
141
 
130
142
  expect(queue).to receive(:change).
131
- with(:dir, subdir2, recursive: true)
143
+ with(:dir, dir, 'subdir2', recursive: true)
132
144
 
133
- described_class.scan(queue, record, dir, options)
145
+ described_class.scan(queue, record, dir, '.', options)
134
146
  end
135
147
  end
136
148
  end
@@ -139,22 +151,28 @@ describe Directory do
139
151
  let(:record_entries) { {} }
140
152
 
141
153
  context 'with non-existing dir' do
142
- before { allow(dir).to receive(:children) { fail Errno::ENOENT } }
154
+ before do
155
+ allow(dir).to receive(:children) { fail Errno::ENOENT }
156
+ end
143
157
 
144
158
  it 'reports no changes' do
145
159
  expect(queue).to_not receive(:change)
146
- described_class.scan(queue, record, dir, options)
160
+ described_class.scan(queue, record, dir, '.', options)
147
161
  end
148
162
  end
149
163
 
150
- context 'with subdir2 present in dir' do
151
- before { allow(dir).to receive(:children) { [subdir2] } }
164
+ context 'with subdir present in dir' do
152
165
 
153
- it 'queues changes for file & file2 paths' do
166
+ before do
167
+ allow(dir).to receive(:children) { [subdir] }
168
+ allow(subdir).to receive(:children) { [] }
169
+ end
170
+
171
+ it 'queues changes for subdir' do
154
172
  expect(queue).to receive(:change).
155
- with(:dir, subdir2, recursive: true)
173
+ with(:dir, dir, 'subdir', recursive: true)
156
174
 
157
- described_class.scan(queue, record, dir, options)
175
+ described_class.scan(queue, record, dir, '.', options)
158
176
  end
159
177
  end
160
178
  end
@@ -4,7 +4,8 @@ describe Listen::File do
4
4
  let(:async_record) do
5
5
  instance_double(
6
6
  Listen::Record,
7
- set_path: true,
7
+ add_dir: true,
8
+ update_file: true,
8
9
  unset_path: true,
9
10
  )
10
11
  end
@@ -18,8 +19,7 @@ describe Listen::File do
18
19
  end
19
20
 
20
21
  let(:path) { Pathname.pwd }
21
- let(:file_path) { path + 'file.rb' }
22
- let(:subject) { described_class.change(record, file_path) }
22
+ let(:subject) { described_class.change(record, path, 'file.rb') }
23
23
 
24
24
  around { |example| fixtures { example.run } }
25
25
 
@@ -30,16 +30,13 @@ describe Listen::File do
30
30
  { mtime: kind_of(Float), mode: kind_of(Integer) }
31
31
  end
32
32
 
33
- context 'with file in record' do
33
+ context 'with file record' do
34
34
  let(:record_mtime) { nil }
35
35
  let(:record_md5) { nil }
36
36
  let(:record_mode) { nil }
37
37
 
38
38
  let(:record_data) do
39
- { type: :file,
40
- mtime: record_mtime,
41
- md5: record_md5,
42
- mode: record_mode }
39
+ { mtime: record_mtime, md5: record_md5, mode: record_mode }
43
40
  end
44
41
 
45
42
  context 'with non-existing file' do
@@ -48,7 +45,7 @@ describe Listen::File do
48
45
  it { should be :removed }
49
46
 
50
47
  it 'sets path in record' do
51
- expect(async_record).to receive(:unset_path).with(file_path)
48
+ expect(async_record).to receive(:unset_path).with(path, 'file.rb')
52
49
  subject
53
50
  end
54
51
  end
@@ -81,8 +78,8 @@ describe Listen::File do
81
78
  it { should be :modified }
82
79
 
83
80
  it 'sets path in record with expected data' do
84
- expect(async_record).to receive(:set_path).
85
- with(:file, file_path, expected_data)
81
+ expect(async_record).to receive(:update_file).
82
+ with(path, 'file.rb', expected_data)
86
83
  subject
87
84
  end
88
85
  end
@@ -97,8 +94,8 @@ describe Listen::File do
97
94
  it { should be :modified }
98
95
 
99
96
  it 'sets path in record with expected data' do
100
- expect(async_record).to receive(:set_path).
101
- with(:file, file_path, expected_data)
97
+ expect(async_record).to receive(:update_file).
98
+ with(path, 'file.rb', expected_data)
102
99
  subject
103
100
  end
104
101
  end
@@ -109,8 +106,8 @@ describe Listen::File do
109
106
  it { should be :modified }
110
107
 
111
108
  it 'sets path in record with expected data' do
112
- expect(async_record).to receive(:set_path).
113
- with(:file, file_path, expected_data)
109
+ expect(async_record).to receive(:update_file).
110
+ with(path, 'file.rb', expected_data)
114
111
  subject
115
112
  end
116
113
  end
@@ -182,8 +179,8 @@ describe Listen::File do
182
179
  it { should be :modified }
183
180
 
184
181
  it 'sets path in record with expected data' do
185
- expect(async_record).to receive(:set_path).
186
- with(:file, file_path, expected_data. merge(md5: md5))
182
+ expect(async_record).to receive(:update_file).
183
+ with(path, 'file.rb', expected_data. merge(md5: md5))
187
184
  subject
188
185
  end
189
186
  end
@@ -216,9 +213,8 @@ describe Listen::File do
216
213
  end
217
214
 
218
215
  it 'sets path in record with expected data' do
219
- expect(async_record).to receive(:set_path).
220
- with(:file, file_path, expected_data)
221
-
216
+ expect(async_record).to receive(:update_file).
217
+ with(path, 'file.rb', expected_data)
222
218
  subject
223
219
  end
224
220
  end