Skip to content

Commit 066a9f3

Browse files
committed
RuboCop: auto-fix spec/truffle
1 parent 1f59ade commit 066a9f3

33 files changed

+60
-60
lines changed

spec/truffle/debug_sepc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.subject(a, b)
2727
it "can add and remove breakpoints" do
2828
breaks = []
2929

30-
breakpoint = Truffle::Debug.break __FILE__, TruffleDebugSpecFixtures::ADD_LINE do |binding|
30+
breakpoint = Truffle::Debug.break __FILE__, TruffleDebugSpecFixtures::ADD_LINE do |_binding|
3131
breaks << [:break]
3232
end
3333

spec/truffle/graal/assert_constant_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
describe "Truffle::Graal.assert_constant" do
1212

1313
it "raises a RuntimeError when called dynamically" do
14-
lambda{ Truffle::Graal.send(:assert_constant, 14 + 2) }.should raise_error(RuntimeError)
14+
-> { Truffle::Graal.send(:assert_constant, 14 + 2) }.should raise_error(RuntimeError)
1515
end
1616

1717
unless TruffleRuby.graal?

spec/truffle/graal/assert_not_compiled_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
describe "Truffle::Graal.assert_not_compiled" do
1212

1313
it "raises a RuntimeError when called dynamically" do
14-
lambda{ Truffle::Graal.send(:assert_not_compiled) }.should raise_error(RuntimeError)
14+
-> { Truffle::Graal.send(:assert_not_compiled) }.should raise_error(RuntimeError)
1515
end
1616

1717
unless TruffleRuby.graal?

spec/truffle/interop/as_pointer_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
describe "Truffle::Interop.as_pointer" do
1313

1414
it "is not supported for nil" do
15-
lambda { Truffle::Interop.as_pointer(nil) }.should raise_error(ArgumentError)
15+
-> { Truffle::Interop.as_pointer(nil) }.should raise_error(ArgumentError)
1616
end
1717

1818
it "is not supported for objects which cannot be converted to a pointer" do
19-
lambda { Truffle::Interop.as_pointer(Object.new) }.should raise_error(ArgumentError)
19+
-> { Truffle::Interop.as_pointer(Object.new) }.should raise_error(ArgumentError)
2020
end
2121

2222
it "works on Truffle::FFI::Pointer" do

spec/truffle/interop/coercion_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
describe "in a numerical operation" do
1414

1515
it "does't interfere with normal coercion" do
16-
lambda { 14 + true }.should raise_error(TypeError, /can't be coerced into Integer/)
17-
lambda { 14 * true }.should raise_error(TypeError, /can't be coerced into Integer/)
18-
lambda { 14.2 + true }.should raise_error(TypeError, /can't be coerced into Float/)
19-
lambda { 14.2 * true }.should raise_error(TypeError, /can't be coerced into Float/)
16+
-> { 14 + true }.should raise_error(TypeError, /can't be coerced into Integer/)
17+
-> { 14 * true }.should raise_error(TypeError, /can't be coerced into Integer/)
18+
-> { 14.2 + true }.should raise_error(TypeError, /can't be coerced into Float/)
19+
-> { 14.2 * true }.should raise_error(TypeError, /can't be coerced into Float/)
2020
(14 + Truffle::Debug.float(2)).should == 16.0
2121
(14.0 + Truffle::Debug.float(2.0)).should == 16.0
2222
end

spec/truffle/interop/executable_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_method
2222
end
2323

2424
it "returns true for lambdas" do
25-
Truffle::Interop.executable?(lambda { }).should be_true
25+
Truffle::Interop.executable?(-> { }).should be_true
2626
end
2727

2828
it "returns false for nil" do

spec/truffle/interop/execute_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ def add(a, b)
2323
end
2424

2525
it "calls lambdas" do
26-
Truffle::Interop.execute(lambda { |a, b| a + b }, 14, 2).should == 16
26+
Truffle::Interop.execute(-> a, b { a + b }, 14, 2).should == 16
2727
end
2828

2929
it "doesn't call nil" do
30-
lambda { Truffle::Interop.execute(nil) }.should raise_error(TypeError)
30+
-> { Truffle::Interop.execute(nil) }.should raise_error(TypeError)
3131
end
3232

3333
it "doesn't call strings" do
34-
lambda { Truffle::Interop.execute('hello') }.should raise_error(TypeError)
34+
-> { Truffle::Interop.execute('hello') }.should raise_error(TypeError)
3535
end
3636

3737
end

spec/truffle/interop/foreign_array_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
end
1717

1818
it "can be printed with #puts" do
19-
lambda {
19+
-> {
2020
puts Truffle::Interop.to_java_array([1, 2, 3])
2121
}.should output(/#<Java:0x\h+ \[1, 2, 3\]>/)
2222
end
2323

2424
it "can be printed with #p" do
25-
lambda {
25+
-> {
2626
p Truffle::Interop.to_java_array([1, 2, 3])
2727
}.should output(/#<Java:0x\h+ \[1, 2, 3\]>/)
2828
end

spec/truffle/interop/foreign_object_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
end
1717

1818
it "can be printed with #puts" do
19-
lambda {
19+
-> {
2020
puts Truffle::Debug.foreign_object
2121
}.should output(/#<Foreign:0x\h+>\n/)
2222
end
2323

2424
it "can be printed with #p" do
25-
lambda {
25+
-> {
2626
p Truffle::Debug.foreign_object
2727
}.should output(/#<Foreign:0x\h+>\n/)
2828
end

spec/truffle/interop/foreign_string_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
end
4040

4141
it "can be printed with #puts" do
42-
lambda {
42+
-> {
4343
puts Truffle::Debug.foreign_string('a')
4444
}.should output("a\n")
4545
end
4646

4747
it "can be printed as if a Ruby string with #p" do
48-
lambda {
48+
-> {
4949
p Truffle::Debug.foreign_string('a')
5050
}.should output("\"a\"\n")
5151
end

0 commit comments

Comments
 (0)