-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathnotimplemented_spec.rb
72 lines (58 loc) · 1.62 KB
/
notimplemented_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
gem 'minitest'
require 'minitest/autorun'
require 'ruby2js'
describe 'not implemented' do
# see https://github.com/whitequark/parser/blob/master/doc/AST_FORMAT.md
def todo(string)
_(proc { Ruby2JS.convert(string, filters: []) }).
must_raise NotImplementedError
end
it "range inclusive" do
# NOTE: for loops and filter/functions will handle the special case of array indexes
# NOTE: filter/rubyjs implements this
# NOTE: .to_a is implemented in send
todo( '1..2' )
end
it "range exclusive" do
# NOTE: for loops and filter/functions will handle the special case of array indexes
# NOTE: filter/rubyjs implements this
todo( '1...2' )
end
it "decomposition" do
# NOTE: option {eslevel: es2015} implements this
todo( 'def f(a, (foo, *bar)); end' )
end
it "class visibility modifiers" do
todo( 'class C; public; end' )
todo( 'class C; private; end' )
todo( 'class C; protected; end' )
end
it "catching exceptions with different variables" do
todo("begin; a; rescue StandardException => se; b; " +
"rescue Exception => e; c; end")
end
it "else clauses in begin...end" do
todo("begin; a; rescue => e; b; else; c; end")
end
it "retry" do
todo("retry")
end
it "flip-flops" do
todo("if a..b; end")
end
it "implicit matches" do
todo("if /a/; end")
end
it "regular expression back-references" do
todo("$&")
todo("$`")
todo("$'")
todo("$+")
end
unless RUBY_VERSION =~ /^1/
# NOTE: option {eslevel: es2015} implements this
it "keyword argument" do
todo( 'def f(a:nil); end' )
end
end
end