Enforce consistent emtpy lines and trailing whitespaces in Ruby code
diff --git a/lib/rb/spec/base_transport_spec.rb b/lib/rb/spec/base_transport_spec.rb
index d2f60aa..d09ba2b 100644
--- a/lib/rb/spec/base_transport_spec.rb
+++ b/lib/rb/spec/base_transport_spec.rb
@@ -48,7 +48,7 @@
it "should alias << to write" do
expect(Thrift::BaseTransport.instance_method(:<<)).to eq(Thrift::BaseTransport.instance_method(:write))
end
-
+
it "should provide a reasonable to_s" do
expect(Thrift::BaseTransport.new.to_s).to eq("base")
end
@@ -67,7 +67,7 @@
transport = double("Transport")
expect(Thrift::BaseTransportFactory.new.get_transport(transport)).to eql(transport)
end
-
+
it "should provide a reasonable to_s" do
expect(Thrift::BaseTransportFactory.new.to_s).to eq("base")
end
@@ -149,7 +149,7 @@
expect(Thrift::BufferedTransport).to receive(:new).with(trans).and_return(btrans)
expect(Thrift::BufferedTransportFactory.new.get_transport(trans)).to eq(btrans)
end
-
+
it "should provide a reasonable to_s" do
expect(Thrift::BufferedTransportFactory.new.to_s).to eq("buffered")
end
@@ -271,7 +271,7 @@
expect(Thrift::FramedTransport).to receive(:new).with(trans)
Thrift::FramedTransportFactory.new.get_transport(trans)
end
-
+
it "should provide a reasonable to_s" do
expect(Thrift::FramedTransportFactory.new.to_s).to eq("framed")
end
diff --git a/lib/rb/spec/binary_protocol_spec_shared.rb b/lib/rb/spec/binary_protocol_spec_shared.rb
index d8edf85..8de39ef 100644
--- a/lib/rb/spec/binary_protocol_spec_shared.rb
+++ b/lib/rb/spec/binary_protocol_spec_shared.rb
@@ -57,7 +57,6 @@
expect(@trans.read(@trans.available)).to eq("\200\001\000\001\000\000\000\vtestMessage\000\000\000\021")
end
-
# message footer is a noop
it "should write the field header" do
diff --git a/lib/rb/spec/compact_protocol_spec.rb b/lib/rb/spec/compact_protocol_spec.rb
index 7519810..e5cb111 100644
--- a/lib/rb/spec/compact_protocol_spec.rb
+++ b/lib/rb/spec/compact_protocol_spec.rb
@@ -31,14 +31,14 @@
:double => [0.0, 1.0, -1.0, 1.1, -1.1, 10000000.1, 1.0/0.0, -1.0/0.0],
:bool => [true, false]
}
-
+
it "should encode and decode naked primitives correctly" do
TESTS.each_pair do |primitive_type, test_values|
test_values.each do |value|
# puts "testing #{value}" if primitive_type == :i64
trans = Thrift::MemoryBufferTransport.new
proto = Thrift::CompactProtocol.new(trans)
-
+
proto.send(writer(primitive_type), value)
# puts "buf: #{trans.inspect_buffer}" if primitive_type == :i64
read_back = proto.send(reader(primitive_type))
@@ -46,7 +46,7 @@
end
end
end
-
+
it "should encode and decode primitives in fields correctly" do
TESTS.each_pair do |primitive_type, test_values|
final_primitive_type = primitive_type == :binary ? :string : primitive_type
@@ -104,7 +104,7 @@
struct.write(proto)
struct2 = Thrift::Test::CompactProtoTestStruct.new
- struct2.read(proto)
+ struct2.read(proto)
expect(struct2).to eq(struct)
end
@@ -123,13 +123,13 @@
processor.process(client_out_proto, client_in_proto)
expect(client.recv_Janky).to eq(2)
end
-
+
it "should deal with fields following fields that have non-delta ids" do
brcp = Thrift::Test::BreaksRubyCompactProtocol.new(
- :field1 => "blah",
+ :field1 => "blah",
:field2 => Thrift::Test::BigFieldIdStruct.new(
- :field1 => "string1",
- :field2 => "string2"),
+ :field1 => "string1",
+ :field2 => "string2"),
:field3 => 3)
ser = Thrift::Serializer.new(Thrift::CompactProtocolFactory.new)
bytes = ser.serialize(brcp)
@@ -139,7 +139,7 @@
deser.deserialize(brcp2, bytes)
expect(brcp2).to eq(brcp)
end
-
+
it "should deserialize an empty map to an empty hash" do
struct = Thrift::Test::SingleMapTestStruct.new(:i32_map => {})
ser = Thrift::Serializer.new(Thrift::CompactProtocolFactory.new)
@@ -150,22 +150,22 @@
deser.deserialize(struct2, bytes)
expect(struct).to eq(struct2)
end
-
+
it "should provide a reasonable to_s" do
trans = Thrift::MemoryBufferTransport.new
expect(Thrift::CompactProtocol.new(trans).to_s).to eq("compact(memory)")
end
-
+
class JankyHandler
def Janky(i32arg)
i32arg * 2
end
end
-
+
def writer(sym)
"write_#{sym.to_s}"
end
-
+
def reader(sym)
"read_#{sym.to_s}"
end
diff --git a/lib/rb/spec/http_client_spec.rb b/lib/rb/spec/http_client_spec.rb
index bc7e128..3c02319 100644
--- a/lib/rb/spec/http_client_spec.rb
+++ b/lib/rb/spec/http_client_spec.rb
@@ -25,7 +25,7 @@
before(:each) do
@client = Thrift::HTTPClientTransport.new("http://my.domain.com/path/to/service?param=value")
end
-
+
it "should provide a reasonable to_s" do
@client.to_s == "http://my.domain.com/path/to/service?param=value"
end
diff --git a/lib/rb/spec/server_spec.rb b/lib/rb/spec/server_spec.rb
index 57f5237..47204aa 100644
--- a/lib/rb/spec/server_spec.rb
+++ b/lib/rb/spec/server_spec.rb
@@ -38,7 +38,7 @@
it "should not serve" do
expect { @server.serve()}.to raise_error(NotImplementedError)
end
-
+
it "should provide a reasonable to_s" do
expect(@serverTrans).to receive(:to_s).once.and_return("serverTrans")
expect(@trans).to receive(:to_s).once.and_return("trans")
@@ -56,14 +56,14 @@
@client = double("Client")
@server = described_class.new(@processor, @serverTrans, @trans, @prot)
end
-
+
it "should provide a reasonable to_s" do
expect(@serverTrans).to receive(:to_s).once.and_return("serverTrans")
expect(@trans).to receive(:to_s).once.and_return("trans")
expect(@prot).to receive(:to_s).once.and_return("prot")
expect(@server.to_s).to eq("simple(server(prot(trans(serverTrans))))")
end
-
+
it "should serve in the main thread" do
expect(@serverTrans).to receive(:listen).ordered
expect(@serverTrans).to receive(:accept).exactly(3).times.and_return(@client)
@@ -99,7 +99,7 @@
expect(@prot).to receive(:to_s).once.and_return("prot")
expect(@server.to_s).to eq("threaded(server(prot(trans(serverTrans))))")
end
-
+
it "should serve using threads" do
expect(@serverTrans).to receive(:listen).ordered
expect(@serverTrans).to receive(:accept).exactly(3).times.and_return(@client)
@@ -137,10 +137,10 @@
expect(@prot).to receive(:to_s).once.and_return("prot")
expect(@server.to_s).to eq("threadpool(server(prot(trans(server_trans))))")
end
-
+
it "should serve inside a thread" do
exception_q = @server.instance_variable_get(:@exception_q)
- expect_any_instance_of(described_class).to receive(:serve) do
+ expect_any_instance_of(described_class).to receive(:serve) do
exception_q.push(StandardError.new('ERROR'))
end
expect { @server.rescuable_serve }.to(raise_error('ERROR'))
@@ -149,7 +149,7 @@
it "should avoid running the server twice when retrying rescuable_serve" do
exception_q = @server.instance_variable_get(:@exception_q)
- expect_any_instance_of(described_class).to receive(:serve) do
+ expect_any_instance_of(described_class).to receive(:serve) do
exception_q.push(StandardError.new('ERROR1'))
exception_q.push(StandardError.new('ERROR2'))
end
diff --git a/lib/rb/spec/unix_socket_spec.rb b/lib/rb/spec/unix_socket_spec.rb
index 8623e95..7f878a1 100644
--- a/lib/rb/spec/unix_socket_spec.rb
+++ b/lib/rb/spec/unix_socket_spec.rb
@@ -42,7 +42,7 @@
allow(::UNIXSocket).to receive(:new)
expect(Thrift::UNIXSocket.new(@path, 5).timeout).to eq(5)
end
-
+
it "should provide a reasonable to_s" do
allow(::UNIXSocket).to receive(:new)
expect(Thrift::UNIXSocket.new(@path).to_s).to eq("domain(#{@path})")