|
1 |
| -require 'opal/nodes' |
2 |
| -class Opal::Nodes::CallNode |
3 |
| - # Rubyspec uses this call to load in language specific features at runtime. |
4 |
| - # We can't do this at runtime, so handle it during compilation |
5 |
| - add_special :language_version do |
6 |
| - if meth == :language_version and scope.top? |
7 |
| - lang_type = arglist[2][1] |
8 |
| - target = "corelib/language/versions/#{lang_type}_1.9" |
9 |
| - |
10 |
| - if File.exist?(target) |
11 |
| - compiler.requires << target |
12 |
| - end |
13 |
| - |
14 |
| - push fragment("nil") |
15 |
| - end |
16 |
| - end |
17 |
| - |
18 |
| - add_special :not_supported_on do |
19 |
| - unless meth == :not_supported_on and arglist[1][1] == :opal |
20 |
| - compile_default! |
21 |
| - end |
22 |
| - end |
23 |
| -end |
24 |
| - |
25 |
| - |
26 | 1 | require 'rack'
|
27 | 2 | require 'webrick'
|
| 3 | +require 'mspec/opal/special_calls' |
28 | 4 |
|
29 | 5 | module MSpec
|
30 | 6 | module Opal
|
@@ -205,16 +181,17 @@ def files_to_run(pattern=nil)
|
205 | 181 |
|
206 | 182 | if pattern
|
207 | 183 | # add custom opal specs from spec/
|
208 |
| - add_files paths_from_glob(pattern) & rubyspec_white_list, :rubyspec_custom_pattern |
209 |
| - add_files paths_from_glob(pattern).grep(/(?!spec\/(corelib|stdlib)\/)/), :other_custom_pattern |
| 184 | + add_files paths_from_glob(pattern) & rubyspec_white_list, :rubyspec_custom |
| 185 | + add_files paths_from_glob(pattern).grep(/(?!spec\/(corelib|stdlib)\/)/), :other_custom |
210 | 186 |
|
211 | 187 | else
|
212 | 188 | # add opal specific specs
|
213 |
| - add_files paths_from_glob("#{basedir}/opal/**/*_spec.rb"), 'opal/*' |
214 |
| - add_files paths_from_glob("#{basedir}/lib/{lexer_spec.rb,parser/**/*_spec.rb}"), 'lib/{lexer,parser}' |
| 189 | + add_files paths_from_glob("#{basedir}/opal/**/*_spec.rb"), :shared |
| 190 | + add_files paths_from_glob("#{basedir}/lib/lexer_spec.rb"), :lexer |
| 191 | + add_files paths_from_glob("#{basedir}/lib/parser/**/*_spec.rb"), :parser |
215 | 192 |
|
216 | 193 | # add any rubyspecs we want to run (defined in spec/rubyspecs)
|
217 |
| - add_files rubyspec_white_list, :rubyspec_white_list |
| 194 | + add_files rubyspec_white_list, :rubyspecs |
218 | 195 | end
|
219 | 196 | end
|
220 | 197 |
|
|
0 commit comments