sass 3.1.21 → 3.2.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. data/README.md +5 -4
  2. data/REVISION +1 -1
  3. data/Rakefile +6 -15
  4. data/VERSION +1 -1
  5. data/VERSION_NAME +1 -1
  6. data/lib/sass.rb +0 -1
  7. data/lib/sass/cache_stores/base.rb +1 -3
  8. data/lib/sass/cache_stores/filesystem.rb +0 -3
  9. data/lib/sass/css.rb +49 -145
  10. data/lib/sass/engine.rb +23 -47
  11. data/lib/sass/environment.rb +5 -30
  12. data/lib/sass/exec.rb +7 -30
  13. data/lib/sass/importers/base.rb +1 -2
  14. data/lib/sass/importers/filesystem.rb +13 -18
  15. data/lib/sass/less.rb +1 -1
  16. data/lib/sass/plugin.rb +8 -4
  17. data/lib/sass/plugin/compiler.rb +67 -93
  18. data/lib/sass/plugin/configuration.rb +2 -0
  19. data/lib/sass/plugin/staleness_checker.rb +4 -14
  20. data/lib/sass/repl.rb +3 -2
  21. data/lib/sass/script.rb +1 -0
  22. data/lib/sass/script/color.rb +9 -4
  23. data/lib/sass/script/funcall.rb +3 -16
  24. data/lib/sass/script/functions.rb +55 -98
  25. data/lib/sass/script/interpolation.rb +0 -9
  26. data/lib/sass/script/lexer.rb +4 -2
  27. data/lib/sass/script/list.rb +0 -8
  28. data/lib/sass/script/literal.rb +20 -5
  29. data/lib/sass/script/node.rb +0 -8
  30. data/lib/sass/script/number.rb +11 -35
  31. data/lib/sass/script/operation.rb +0 -16
  32. data/lib/sass/script/parser.rb +5 -12
  33. data/lib/sass/script/string_interpolation.rb +0 -9
  34. data/lib/sass/script/unary_operation.rb +0 -7
  35. data/lib/sass/script/variable.rb +1 -5
  36. data/lib/sass/scss/parser.rb +54 -191
  37. data/lib/sass/scss/rx.rb +3 -15
  38. data/lib/sass/scss/static_parser.rb +3 -3
  39. data/lib/sass/selector.rb +3 -15
  40. data/lib/sass/selector/abstract_sequence.rb +2 -11
  41. data/lib/sass/selector/comma_sequence.rb +3 -8
  42. data/lib/sass/selector/sequence.rb +11 -74
  43. data/lib/sass/selector/simple.rb +1 -7
  44. data/lib/sass/selector/simple_sequence.rb +8 -28
  45. data/lib/sass/shared.rb +5 -3
  46. data/lib/sass/tree/comment_node.rb +12 -25
  47. data/lib/sass/tree/debug_node.rb +1 -1
  48. data/lib/sass/tree/directive_node.rb +0 -5
  49. data/lib/sass/tree/each_node.rb +1 -1
  50. data/lib/sass/tree/extend_node.rb +1 -1
  51. data/lib/sass/tree/for_node.rb +2 -2
  52. data/lib/sass/tree/function_node.rb +1 -1
  53. data/lib/sass/tree/if_node.rb +14 -1
  54. data/lib/sass/tree/media_node.rb +4 -4
  55. data/lib/sass/tree/mixin_def_node.rb +1 -1
  56. data/lib/sass/tree/mixin_node.rb +2 -2
  57. data/lib/sass/tree/node.rb +26 -10
  58. data/lib/sass/tree/return_node.rb +1 -1
  59. data/lib/sass/tree/root_node.rb +1 -1
  60. data/lib/sass/tree/rule_node.rb +11 -9
  61. data/lib/sass/tree/variable_node.rb +1 -1
  62. data/lib/sass/tree/visitors/base.rb +1 -1
  63. data/lib/sass/tree/visitors/check_nesting.rb +36 -29
  64. data/lib/sass/tree/visitors/convert.rb +9 -16
  65. data/lib/sass/tree/visitors/cssize.rb +9 -40
  66. data/lib/sass/tree/visitors/perform.rb +23 -79
  67. data/lib/sass/tree/visitors/to_css.rb +21 -23
  68. data/lib/sass/tree/warn_node.rb +1 -1
  69. data/lib/sass/tree/while_node.rb +1 -1
  70. data/lib/sass/util.rb +9 -147
  71. data/lib/sass/version.rb +0 -14
  72. data/test/sass/cache_test.rb +0 -15
  73. data/test/sass/conversion_test.rb +8 -50
  74. data/test/sass/css2sass_test.rb +0 -33
  75. data/test/sass/engine_test.rb +32 -283
  76. data/test/sass/extend_test.rb +0 -315
  77. data/test/sass/functions_test.rb +23 -60
  78. data/test/sass/importer_test.rb +0 -110
  79. data/test/sass/more_results/more_import.css +2 -2
  80. data/test/sass/plugin_test.rb +13 -40
  81. data/test/sass/results/import.css +2 -2
  82. data/test/sass/results/import_charset.css +0 -1
  83. data/test/sass/results/import_charset_1_8.css +0 -1
  84. data/test/sass/results/import_charset_ibm866.css +0 -1
  85. data/test/sass/results/scss_import.css +2 -2
  86. data/test/sass/results/units.css +1 -1
  87. data/test/sass/script_conversion_test.rb +0 -2
  88. data/test/sass/script_test.rb +4 -28
  89. data/test/sass/scss/css_test.rb +1 -79
  90. data/test/sass/scss/scss_test.rb +16 -96
  91. data/test/sass/templates/import_charset.sass +0 -2
  92. data/test/sass/templates/import_charset_1_8.sass +0 -2
  93. data/test/sass/templates/import_charset_ibm866.sass +0 -2
  94. data/test/sass/test_helper.rb +1 -1
  95. data/test/sass/util_test.rb +0 -28
  96. data/test/test_helper.rb +0 -2
  97. data/vendor/{listen → fssm}/LICENSE +1 -1
  98. data/vendor/fssm/README.markdown +55 -0
  99. data/vendor/fssm/Rakefile +59 -0
  100. data/vendor/fssm/VERSION.yml +5 -0
  101. data/vendor/fssm/example.rb +9 -0
  102. data/vendor/fssm/fssm.gemspec +77 -0
  103. data/vendor/fssm/lib/fssm.rb +33 -0
  104. data/vendor/fssm/lib/fssm/backends/fsevents.rb +36 -0
  105. data/vendor/fssm/lib/fssm/backends/inotify.rb +26 -0
  106. data/vendor/fssm/lib/fssm/backends/polling.rb +25 -0
  107. data/vendor/fssm/lib/fssm/backends/rubycocoa/fsevents.rb +131 -0
  108. data/vendor/fssm/lib/fssm/monitor.rb +26 -0
  109. data/vendor/fssm/lib/fssm/path.rb +91 -0
  110. data/vendor/fssm/lib/fssm/pathname.rb +502 -0
  111. data/vendor/fssm/lib/fssm/state/directory.rb +57 -0
  112. data/vendor/fssm/lib/fssm/state/file.rb +24 -0
  113. data/vendor/fssm/lib/fssm/support.rb +63 -0
  114. data/vendor/fssm/lib/fssm/tree.rb +176 -0
  115. data/vendor/fssm/profile/prof-cache.rb +40 -0
  116. data/vendor/fssm/profile/prof-fssm-pathname.html +1231 -0
  117. data/vendor/fssm/profile/prof-pathname.rb +68 -0
  118. data/vendor/fssm/profile/prof-plain-pathname.html +988 -0
  119. data/vendor/fssm/profile/prof.html +2379 -0
  120. data/vendor/fssm/spec/path_spec.rb +75 -0
  121. data/vendor/fssm/spec/root/duck/quack.txt +0 -0
  122. data/vendor/fssm/spec/root/file.css +0 -0
  123. data/vendor/fssm/spec/root/file.rb +0 -0
  124. data/vendor/fssm/spec/root/file.yml +0 -0
  125. data/vendor/fssm/spec/root/moo/cow.txt +0 -0
  126. data/vendor/fssm/spec/spec_helper.rb +14 -0
  127. metadata +246 -281
  128. data/VERSION_DATE +0 -1
  129. data/lib/sass/logger.rb +0 -15
  130. data/lib/sass/logger/base.rb +0 -32
  131. data/lib/sass/logger/log_level.rb +0 -49
  132. data/lib/sass/tree/visitors/deep_copy.rb +0 -87
  133. data/lib/sass/tree/visitors/extend.rb +0 -42
  134. data/lib/sass/tree/visitors/set_options.rb +0 -97
  135. data/lib/sass/util/multibyte_string_scanner.rb +0 -134
  136. data/test/Gemfile +0 -4
  137. data/test/Gemfile.lock +0 -19
  138. data/test/sass/fixtures/test_staleness_check_across_importers.css +0 -1
  139. data/test/sass/fixtures/test_staleness_check_across_importers.scss +0 -1
  140. data/test/sass/logger_test.rb +0 -58
  141. data/test/sass/templates/_double_import_loop2.sass +0 -1
  142. data/test/sass/templates/bork5.sass +0 -3
  143. data/test/sass/templates/double_import_loop1.sass +0 -1
  144. data/test/sass/templates/nested_bork5.sass +0 -2
  145. data/test/sass/templates/single_import_loop.sass +0 -1
  146. data/test/sass/util/multibyte_string_scanner_test.rb +0 -147
  147. data/vendor/listen/CHANGELOG.md +0 -147
  148. data/vendor/listen/Gemfile +0 -23
  149. data/vendor/listen/Guardfile +0 -8
  150. data/vendor/listen/README.md +0 -312
  151. data/vendor/listen/Rakefile +0 -47
  152. data/vendor/listen/Vagrantfile +0 -96
  153. data/vendor/listen/lib/listen.rb +0 -38
  154. data/vendor/listen/lib/listen/adapter.rb +0 -167
  155. data/vendor/listen/lib/listen/adapters/darwin.rb +0 -84
  156. data/vendor/listen/lib/listen/adapters/linux.rb +0 -110
  157. data/vendor/listen/lib/listen/adapters/polling.rb +0 -66
  158. data/vendor/listen/lib/listen/adapters/windows.rb +0 -81
  159. data/vendor/listen/lib/listen/directory_record.rb +0 -318
  160. data/vendor/listen/lib/listen/listener.rb +0 -203
  161. data/vendor/listen/lib/listen/multi_listener.rb +0 -121
  162. data/vendor/listen/lib/listen/turnstile.rb +0 -28
  163. data/vendor/listen/lib/listen/version.rb +0 -3
  164. data/vendor/listen/listen.gemspec +0 -26
  165. data/vendor/listen/spec/listen/adapter_spec.rb +0 -142
  166. data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -31
  167. data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -41
  168. data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
  169. data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -24
  170. data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1138
  171. data/vendor/listen/spec/listen/listener_spec.rb +0 -155
  172. data/vendor/listen/spec/listen/multi_listener_spec.rb +0 -156
  173. data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
  174. data/vendor/listen/spec/listen_spec.rb +0 -73
  175. data/vendor/listen/spec/spec_helper.rb +0 -18
  176. data/vendor/listen/spec/support/adapter_helper.rb +0 -716
  177. data/vendor/listen/spec/support/directory_record_helper.rb +0 -55
  178. data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
  179. data/vendor/listen/spec/support/listeners_helper.rb +0 -144
  180. data/vendor/listen/spec/support/platform_helper.rb +0 -11
@@ -1,155 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Listen::Listener do
4
- let(:adapter) { mock(Listen::Adapter, :start => true).as_null_object }
5
- let(:watched_directory) { File.dirname(__FILE__) }
6
-
7
- subject { described_class.new(watched_directory) }
8
-
9
- before do
10
- Listen::Adapter.stub(:select_and_initialize) { adapter }
11
- # Don't build a record of the files inside the base directory.
12
- subject.directory_record.stub(:build)
13
- end
14
-
15
- it_should_behave_like 'a listener to changes on a file-system'
16
-
17
- describe '#initialize' do
18
- context 'with no options' do
19
- it 'sets the directory' do
20
- subject.directory.should eq watched_directory
21
- end
22
-
23
- it 'converts the passed path into an absolute path - #21' do
24
- described_class.new(File.join(watched_directory, '..')).directory.should eq File.expand_path('..', watched_directory)
25
- end
26
-
27
- it 'sets the option for using relative paths in the callback to the default one' do
28
- subject.instance_variable_get(:@use_relative_paths).should eq described_class::DEFAULT_TO_RELATIVE_PATHS
29
- end
30
- end
31
-
32
- context 'with custom options' do
33
- subject { described_class.new(watched_directory, :ignore => /\.ssh/, :filter => [/.*\.rb/,/.*\.md/],
34
- :latency => 0.5, :force_polling => true, :relative_paths => true) }
35
-
36
- it 'passes the custom ignored paths to the directory record' do
37
- subject.directory_record.ignoring_patterns.should include /\.ssh/
38
- end
39
-
40
- it 'passes the custom filters to the directory record' do
41
- subject.directory_record.filtering_patterns.should =~ [/.*\.rb/,/.*\.md/]
42
- end
43
-
44
- it 'sets the cutom option for using relative paths in the callback' do
45
- subject.instance_variable_get(:@use_relative_paths).should be_true
46
- end
47
-
48
- it 'sets adapter_options' do
49
- subject.instance_variable_get(:@adapter_options).should eq(:latency => 0.5, :force_polling => true)
50
- end
51
- end
52
- end
53
-
54
- describe '#start' do
55
- it 'selects and initializes an adapter' do
56
- Listen::Adapter.should_receive(:select_and_initialize).with(watched_directory, {}) { adapter }
57
- subject.start
58
- end
59
-
60
- it 'builds the directory record' do
61
- subject.directory_record.should_receive(:build)
62
- subject.start
63
- end
64
- end
65
-
66
- context 'with a started listener' do
67
- before do
68
- subject.stub(:initialize_adapter) { adapter }
69
- subject.start
70
- end
71
-
72
- describe '#unpause' do
73
- it 'rebuilds the directory record' do
74
- subject.directory_record.should_receive(:build)
75
- subject.unpause
76
- end
77
- end
78
- end
79
-
80
- describe '#ignore'do
81
- it 'delegates the work to the directory record' do
82
- subject.directory_record.should_receive(:ignore).with 'some_directory'
83
- subject.ignore 'some_directory'
84
- end
85
- end
86
-
87
- describe '#filter' do
88
- it 'delegates the work to the directory record' do
89
- subject.directory_record.should_receive(:filter).with /\.txt$/
90
- subject.filter /\.txt$/
91
- end
92
- end
93
-
94
-
95
- describe '#on_change' do
96
- let(:directories) { %w{dir1 dir2 dir3} }
97
- let(:changes) { {:modified => [], :added => [], :removed => []} }
98
- let(:callback) { Proc.new { @called = true } }
99
-
100
- before do
101
- @called = false
102
- subject.directory_record.stub(:fetch_changes => changes)
103
- end
104
-
105
- it 'fetches the changes of the directory record' do
106
- subject.directory_record.should_receive(:fetch_changes).with(
107
- directories, hash_including(:relative_paths => described_class::DEFAULT_TO_RELATIVE_PATHS)
108
- )
109
- subject.on_change(directories)
110
- end
111
-
112
- context 'with relative paths option set to true' do
113
- subject { described_class.new(watched_directory, :relative_paths => true) }
114
-
115
- it 'fetches the changes of the directory record' do
116
- subject.directory_record.should_receive(:fetch_changes).with(directories, hash_including(:relative_paths => true))
117
- subject.on_change(directories)
118
- end
119
- end
120
-
121
- context 'with no changes to report' do
122
- if RUBY_VERSION[/^1.8/]
123
- it 'does not run the callback' do
124
- subject.change(&callback)
125
- subject.on_change(directories)
126
- @called.should be_false
127
- end
128
- else
129
- it 'does not run the callback' do
130
- callback.should_not_receive(:call)
131
- subject.change(&callback)
132
- subject.on_change(directories)
133
- end
134
- end
135
- end
136
-
137
- context 'with changes to report' do
138
- let(:changes) { {:modified => %w{path1}, :added => [], :removed => %w{path2}} }
139
-
140
- if RUBY_VERSION[/^1.8/]
141
- it 'runs the callback passing it the changes' do
142
- subject.change(&callback)
143
- subject.on_change(directories)
144
- @called.should be_true
145
- end
146
- else
147
- it 'runs the callback passing it the changes' do
148
- callback.should_receive(:call).with(changes[:modified], changes[:added], changes[:removed])
149
- subject.change(&callback)
150
- subject.on_change(directories)
151
- end
152
- end
153
- end
154
- end
155
- end
@@ -1,156 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Listen::MultiListener do
4
- let(:adapter) { mock(Listen::Adapter, :start => true).as_null_object }
5
- let(:watched_directories) { [File.dirname(__FILE__), File.expand_path('../..', __FILE__)] }
6
-
7
- subject { described_class.new(*watched_directories) }
8
-
9
- before do
10
- Listen::Adapter.stub(:select_and_initialize) { adapter }
11
- # Don't build a record of the files inside the base directory.
12
- Listen::DirectoryRecord.any_instance.stub(:build)
13
- end
14
-
15
- it_should_behave_like 'a listener to changes on a file-system'
16
-
17
- describe '#initialize' do
18
- context 'with no options' do
19
- it 'sets the directories' do
20
- subject.directories.should =~ watched_directories
21
- end
22
-
23
- it 'converts the passed paths into absolute paths - #21' do
24
- paths = watched_directories.map { |d| File.join(d, '..') }
25
- described_class.new(*paths).directories.should =~ watched_directories.map{ |d| File.expand_path('..', d) }
26
- end
27
- end
28
-
29
- context 'with custom options' do
30
- subject do
31
- args = watched_directories << {:ignore => /\.ssh/, :filter => [/.*\.rb/,/.*\.md/], :latency => 0.5, :force_polling => true}
32
- described_class.new(*args)
33
- end
34
-
35
- it 'passes the custom ignored paths to each directory record' do
36
- subject.directories_records.each do |r|
37
- r.ignoring_patterns.should include /\.ssh/
38
- end
39
- end
40
-
41
- it 'passes the custom filters to each directory record' do
42
- subject.directories_records.each do |r|
43
- r.filtering_patterns.should =~ [/.*\.rb/,/.*\.md/]
44
- end
45
- end
46
-
47
- it 'sets adapter_options' do
48
- subject.instance_variable_get(:@adapter_options).should eq(:latency => 0.5, :force_polling => true)
49
- end
50
- end
51
- end
52
-
53
- describe '#start' do
54
- it 'selects and initializes an adapter' do
55
- Listen::Adapter.should_receive(:select_and_initialize).with(watched_directories, {}) { adapter }
56
- subject.start
57
- end
58
-
59
- it 'builds all directories records' do
60
- subject.directories_records.each do |r|
61
- r.should_receive(:build)
62
- end
63
- subject.start
64
- end
65
- end
66
-
67
- context 'with a started listener' do
68
- before do
69
- subject.stub(:initialize_adapter) { adapter }
70
- subject.start
71
- end
72
-
73
- describe '#unpause' do
74
- it 'rebuilds all directories records' do
75
- subject.directories_records.each do |r|
76
- r.should_receive(:build)
77
- end
78
- subject.unpause
79
- end
80
- end
81
- end
82
-
83
- describe '#ignore'do
84
- it 'delegates the work to each directory record' do
85
- subject.directories_records.each do |r|
86
- r.should_receive(:ignore).with 'some_directory'
87
- end
88
- subject.ignore 'some_directory'
89
- end
90
- end
91
-
92
- describe '#filter' do
93
- it 'delegates the work to each directory record' do
94
- subject.directories_records.each do |r|
95
- r.should_receive(:filter).with /\.txt$/
96
- end
97
- subject.filter /\.txt$/
98
- end
99
- end
100
-
101
- describe '#on_change' do
102
- let(:directories) { %w{dir1 dir2 dir3} }
103
- let(:changes) { {:modified => [], :added => [], :removed => []} }
104
- let(:callback) { Proc.new { @called = true } }
105
-
106
- before do
107
- @called = false
108
- subject.stub(:fetch_records_changes => changes)
109
- end
110
-
111
- it 'fetches the changes of all directories records' do
112
- subject.unstub(:fetch_records_changes)
113
-
114
- subject.directories_records.each do |record|
115
- record.should_receive(:fetch_changes).with(
116
- directories, hash_including(:relative_paths => described_class::DEFAULT_TO_RELATIVE_PATHS)
117
- ).and_return(changes)
118
- end
119
- subject.on_change(directories)
120
- end
121
-
122
- context 'with no changes to report' do
123
- if RUBY_VERSION[/^1.8/]
124
- it 'does not run the callback' do
125
- subject.change(&callback)
126
- subject.on_change(directories)
127
- @called.should be_false
128
- end
129
- else
130
- it 'does not run the callback' do
131
- callback.should_not_receive(:call)
132
- subject.change(&callback)
133
- subject.on_change(directories)
134
- end
135
- end
136
- end
137
-
138
- context 'with changes to report' do
139
- let(:changes) { {:modified => %w{path1}, :added => [], :removed => %w{path2}} }
140
-
141
- if RUBY_VERSION[/^1.8/]
142
- it 'runs the callback passing it the changes' do
143
- subject.change(&callback)
144
- subject.on_change(directories)
145
- @called.should be_true
146
- end
147
- else
148
- it 'runs the callback passing it the changes' do
149
- callback.should_receive(:call).with(changes[:modified], changes[:added], changes[:removed])
150
- subject.change(&callback)
151
- subject.on_change(directories)
152
- end
153
- end
154
- end
155
- end
156
- end
@@ -1,56 +0,0 @@
1
- require 'spec_helper'
2
-
3
- def run_in_two_threads(proc1, proc2)
4
- t1 = Thread.new &proc1
5
- sleep test_latency # t1 must run before t2
6
- t2 = Thread.new { proc2.call; Thread.kill t1 }
7
- t2.join(test_latency * 2)
8
- ensure
9
- Thread.kill t1 if t1
10
- Thread.kill t2 if t2
11
- end
12
-
13
- describe Listen::Turnstile do
14
- before { @called = false }
15
-
16
- describe '#wait' do
17
- context 'without a signal' do
18
- it 'blocks one thread indefinitely' do
19
- run_in_two_threads lambda {
20
- subject.wait
21
- @called = true
22
- }, lambda {
23
- sleep test_latency
24
- }
25
- @called.should be_false
26
- end
27
- end
28
-
29
- context 'with a signal' do
30
- it 'blocks one thread until it recieves a signal from another thread' do
31
- run_in_two_threads lambda {
32
- subject.wait
33
- @called = true
34
- }, lambda {
35
- subject.signal
36
- sleep test_latency
37
- }
38
- @called.should be_true
39
- end
40
- end
41
- end
42
-
43
- describe '#signal' do
44
- context 'without a wait-call before' do
45
- it 'does nothing' do
46
- run_in_two_threads lambda {
47
- subject.signal
48
- @called = true
49
- }, lambda {
50
- sleep test_latency
51
- }
52
- @called.should be_true
53
- end
54
- end
55
- end
56
- end
@@ -1,73 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Listen do
4
- describe '#to' do
5
- context 'with one path to listen to' do
6
- let(:listener) { mock(Listen::Listener) }
7
- let(:listener_class) { Listen::Listener }
8
-
9
- before { listener_class.stub(:new => listener) }
10
-
11
- context 'without options' do
12
- it 'creates an instance of Listner' do
13
- listener_class.should_receive(:new).with('/path')
14
- described_class.to('/path')
15
- end
16
- end
17
-
18
- context 'with options' do
19
- it 'creates an instance of Listner with the passed params' do
20
- listener_class.should_receive(:new).with('/path', :filter => '**/*')
21
- described_class.to('/path', :filter => '**/*')
22
- end
23
- end
24
-
25
- context 'without a block' do
26
- it 'returns the listener' do
27
- described_class.to('/path', :filter => '**/*').should eq listener
28
- end
29
- end
30
-
31
- context 'with a block' do
32
- it 'starts the listner after creating it' do
33
- listener.should_receive(:start)
34
- described_class.to('/path', :filter => '**/*') { |modified, added, removed| }
35
- end
36
- end
37
- end
38
-
39
- context 'with multiple paths to listen to' do
40
- let(:multi_listener) { mock(Listen::MultiListener) }
41
- let(:multi_listener_class) { Listen::MultiListener }
42
-
43
- before { multi_listener_class.stub(:new => multi_listener) }
44
-
45
- context 'without options' do
46
- it 'creates an instance of MultiListner' do
47
- multi_listener_class.should_receive(:new).with('path1', 'path2')
48
- described_class.to('path1', 'path2')
49
- end
50
- end
51
-
52
- context 'with options' do
53
- it 'creates an instance of MultiListner with the passed params' do
54
- multi_listener_class.should_receive(:new).with('path1', 'path2', :filter => '**/*')
55
- described_class.to('path1', 'path2', :filter => '**/*')
56
- end
57
- end
58
-
59
- context 'without a block' do
60
- it 'returns a MultiListener instance created with the passed params' do
61
- described_class.to('path1', 'path2', :filter => '**/*').should eq multi_listener
62
- end
63
- end
64
-
65
- context 'with a block' do
66
- it 'starts a MultiListener instance after creating it with the passed params' do
67
- multi_listener.should_receive(:start)
68
- described_class.to('path1', 'path2', :filter => '**/*') { |modified, added, removed| }
69
- end
70
- end
71
- end
72
- end
73
- end
@@ -1,18 +0,0 @@
1
- require 'listen'
2
-
3
- ENV["TEST_LATENCY"] ||= "0.25"
4
-
5
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
6
-
7
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
8
- RSpec.configure do |config|
9
- config.color_enabled = true
10
- config.order = :random
11
- config.filter_run :focus => true
12
- config.treat_symbols_as_metadata_keys_with_true_values = true
13
- config.run_all_when_everything_filtered = true
14
- end
15
-
16
- def test_latency
17
- ENV["TEST_LATENCY"].to_f
18
- end