Skip to content

Commit 0801f8a

Browse files
committed
eliminate deprecation warnings
1 parent 5ce6c13 commit 0801f8a

26 files changed

+108
-100
lines changed

spec/camelcase_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
describe Ruby2JS::Filter::CamelCase do
66

77
def to_js( string)
8-
Ruby2JS.convert(string, filters: [Ruby2JS::Filter::CamelCase]).to_s
8+
_(Ruby2JS.convert(string, filters: [Ruby2JS::Filter::CamelCase]).to_s)
99
end
1010

1111
describe :camelCase do
@@ -44,7 +44,7 @@ def to_js( string)
4444

4545
describe Ruby2JS::Filter::DEFAULTS do
4646
it "should include CamelCase" do
47-
Ruby2JS::Filter::DEFAULTS.must_include Ruby2JS::Filter::CamelCase
47+
_(Ruby2JS::Filter::DEFAULTS).must_include Ruby2JS::Filter::CamelCase
4848
end
4949
end
5050
end

spec/cjs_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,58 @@
55
describe Ruby2JS::Filter::CJS do
66

77
def to_js( string)
8-
Ruby2JS.convert(string, filters: [Ruby2JS::Filter::CJS],
9-
file: __FILE__, eslevel: 2017)
8+
_(Ruby2JS.convert(string, filters: [Ruby2JS::Filter::CJS],
9+
file: __FILE__, eslevel: 2017).to_s)
1010
end
1111

1212
def to_js_fn( string)
13-
Ruby2JS.convert(string,
13+
_(Ruby2JS.convert(string,
1414
filters: [Ruby2JS::Filter::CJS, Ruby2JS::Filter::Functions],
15-
file: __FILE__, eslevel: 2017)
15+
file: __FILE__, eslevel: 2017).to_s)
1616
end
1717

1818
describe :exports do
1919
it "should export a simple function" do
20-
to_js( 'export def f(a); return a; end' ).to_s.
20+
to_js( 'export def f(a); return a; end' ).
2121
must_equal 'exports.f = a => a'
2222
end
2323

2424
it "should export an async function" do
25-
to_js( 'export async def f(a, b); return a; end' ).to_s.
25+
to_js( 'export async def f(a, b); return a; end' ).
2626
must_equal 'exports.f = async (a, b) => a'
2727
end
2828

2929
it "should export a value" do
30-
to_js( 'export foo = 1' ).to_s.
30+
to_js( 'export foo = 1' ).
3131
must_equal 'exports.foo = 1'
3232
end
3333

3434
it "should convert .inspect into JSON.stringify()" do
35-
to_js_fn( 'export async def f(a, b); return {input: a}.inspect; end' ).to_s.
35+
to_js_fn( 'export async def f(a, b); return {input: a}.inspect; end' ).
3636
must_equal 'exports.f = async (a, b) => JSON.stringify({input: a})'
3737
end
3838
end
3939

4040
describe :default do
4141
it "should export a simple function" do
42-
to_js( 'export default proc do |a|; return a; end' ).to_s.
42+
to_js( 'export default proc do |a|; return a; end' ).
4343
must_equal 'module.exports = a => a'
4444
end
4545

4646
it "should export an async function" do
47-
to_js( 'export default async proc do |a, b| return a; end' ).to_s.
47+
to_js( 'export default async proc do |a, b| return a; end' ).
4848
must_equal 'module.exports = async (a, b) => a'
4949
end
5050

5151
it "should export a value" do
52-
to_js( 'export default 1' ).to_s.
52+
to_js( 'export default 1' ).
5353
must_equal 'module.exports = 1'
5454
end
5555
end
5656

5757
describe Ruby2JS::Filter::DEFAULTS do
5858
it "should include CJS" do
59-
Ruby2JS::Filter::DEFAULTS.must_include Ruby2JS::Filter::CJS
59+
_(Ruby2JS::Filter::DEFAULTS).must_include Ruby2JS::Filter::CJS
6060
end
6161
end
6262
end

spec/comments_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
describe Ruby2JS::Filter::Functions do
66

77
def to_js( string)
8-
Ruby2JS.convert(string, filters: [Ruby2JS::Filter::Functions]).to_s
8+
_(Ruby2JS.convert(string, filters: [Ruby2JS::Filter::Functions]).to_s)
99
end
1010

1111
describe 'conversions' do

spec/es2015_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
describe "ES2015 support" do
55

66
def to_js(string)
7-
Ruby2JS.convert(string, eslevel: 2015, filters: []).to_s
7+
_(Ruby2JS.convert(string, eslevel: 2015, filters: []).to_s)
88
end
99

1010
def to_js_fn(string)
11-
Ruby2JS.convert(string, eslevel: 2015,
12-
filters: [Ruby2JS::Filter::Functions]).to_s
11+
_(Ruby2JS.convert(string, eslevel: 2015,
12+
filters: [Ruby2JS::Filter::Functions]).to_s)
1313
end
1414

1515
describe :vars do

spec/es2016_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
describe "ES2016 support" do
55

66
def to_js(string)
7-
Ruby2JS.convert(string, eslevel: 2016, filters: []).to_s
7+
_(Ruby2JS.convert(string, eslevel: 2016, filters: []).to_s)
88
end
99

1010
def to_js_fn(string)
11-
Ruby2JS.convert(string, eslevel: 2016,
12-
filters: [Ruby2JS::Filter::Functions]).to_s
11+
_(Ruby2JS.convert(string, eslevel: 2016,
12+
filters: [Ruby2JS::Filter::Functions]).to_s)
1313
end
1414

1515
describe :operator do

spec/es2017_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
describe "ES2017 support" do
55

66
def to_js( string)
7-
Ruby2JS.convert(string, eslevel: 2017, filters: []).to_s
7+
_(Ruby2JS.convert(string, eslevel: 2017, filters: []).to_s)
88
end
99

1010
def to_js_fn(string)
11-
Ruby2JS.convert(string, eslevel: 2017,
12-
filters: [Ruby2JS::Filter::Functions]).to_s
11+
_(Ruby2JS.convert(string, eslevel: 2017,
12+
filters: [Ruby2JS::Filter::Functions]).to_s)
1313
end
1414

1515
describe :String do

spec/es2018_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
describe "ES2018 support" do
55

66
def to_js(string)
7-
Ruby2JS.convert(string, eslevel: 2018, filters: []).to_s
7+
_(Ruby2JS.convert(string, eslevel: 2018, filters: []).to_s)
88
end
99

1010
def to_js_fn(string)
11-
Ruby2JS.convert(string, eslevel: 2018,
12-
filters: [Ruby2JS::Filter::Functions]).to_s
11+
_(Ruby2JS.convert(string, eslevel: 2018,
12+
filters: [Ruby2JS::Filter::Functions]).to_s)
1313
end
1414

1515
describe :Hash_Spread do

spec/es2019_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
describe "ES2019 support" do
55

66
def to_js( string)
7-
Ruby2JS.convert(string, eslevel: 2019, filters: []).to_s
7+
_(Ruby2JS.convert(string, eslevel: 2019, filters: []).to_s)
88
end
99

1010
def to_js_fn(string)
11-
Ruby2JS.convert(string, eslevel: 2019,
12-
filters: [Ruby2JS::Filter::Functions]).to_s
11+
_(Ruby2JS.convert(string, eslevel: 2019,
12+
filters: [Ruby2JS::Filter::Functions]).to_s)
1313
end
1414

1515
describe :Exception do

spec/exclude_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
describe 'Ruby2JS::Filter.exclude' do
66

77
def to_js( string, options={} )
8-
Ruby2JS.convert(string,
9-
options.merge(filters: [Ruby2JS::Filter::Functions])).to_s
8+
_(Ruby2JS.convert(string,
9+
options.merge(filters: [Ruby2JS::Filter::Functions])).to_s)
1010
end
1111

1212
describe 'default exclude' do

spec/execjs_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313

1414
it "should handle compile" do
1515
skip if @skip
16-
Ruby2JS.compile('i=1').eval('i+1').must_equal 2
16+
_(Ruby2JS.compile('i=1').eval('i+1')).must_equal 2
1717
end
1818

1919
it "should handle eval" do
2020
skip if @skip
21-
Ruby2JS.eval('"abc" =~ /b/', filters: []).must_equal true
21+
_(Ruby2JS.eval('"abc" =~ /b/', filters: [])).must_equal true
2222
end
2323

2424
it "should handle exec" do
2525
skip if @skip
26-
Ruby2JS.exec('x=%w(a b); x << "c"; return x.pop()').must_equal 'c'
26+
_(Ruby2JS.exec('x=%w(a b); x << "c"; return x.pop()')).must_equal 'c'
2727
end
2828
end

0 commit comments

Comments
 (0)