Permalink
Browse files

Whitespace

  • Loading branch information...
1 parent b135b6e commit 7915e01f8d761b4dcecf6d2c8047b2bc5256ee9c @sstephenson committed Feb 25, 2010
Showing with 11 additions and 6 deletions.
  1. +6 −1 Rakefile
  2. +1 −1 lib/hector/identity.rb
  3. +2 −2 test/integration/channels_test.rb
  4. +1 −1 test/unit/request_test.rb
  5. +1 −1 test/unit/session_test.rb
View
@@ -18,4 +18,9 @@ begin
t.verbose = true
end
rescue LoadError
-end
+end
+
+desc "Removes trailing whitespace and replaces tabs with two spaces"
+task :whitespace do
+ sh %[find . \\( -name '*.rb' -or -name '*.yml' \\) -type f -exec ruby -pi -e 'gsub(/ +$/, "");gsub(/\t/, " ")' {} \\;]
+end
View
@@ -40,7 +40,7 @@ def initialize(username, password)
def authenticate(password)
self.hash_password(password) == @password
end
-
+
def hash_password(password)
Digest::SHA1.hexdigest(Digest::SHA1.hexdigest(@username) + password)
end
@@ -105,7 +105,7 @@ class ChannelsTest < IntegrationTest
assert_sent_to c1, ":hector.irc 366 user1 #test :"
end
end
-
+
test :"names command should be split into 512-byte responses" do
authenticated_connections(:join => "#test") do |c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40, c41, c42, c43, c44, c45, c46, c47, c48, c49, c50, c51, c52, c53, c54, c55, c56, c57, c58, c59, c60, c61, c62, c63, c64, c65, c66, c67, c68, c69, c70|
c1.receive_line "NAMES #test"
@@ -194,7 +194,7 @@ class ChannelsTest < IntegrationTest
assert_sent_to c2, "315 #test"
end
end
-
+
test :"sending a WHO command to an active channel you've not yet joined should still list everyone" do
authenticated_connections do |c1, c2, c3|
c1.receive_line "JOIN #test"
@@ -16,7 +16,7 @@ class RequestTest < TestCase
test :"a command with text but no arguments" do
assert_request :command => "QUIT", :args => ["foo"], :text => "foo", :line => "QUIT :foo"
- assert_request :command => "QUIT", :args => ["foo bar"], :text => "foo bar", :line => "QUIT :foo bar"
+ assert_request :command => "QUIT", :args => ["foo bar"], :text => "foo bar", :line => "QUIT :foo bar"
assert_request :command => "QUIT", :args => ["foo"], :text => "foo", :line => "QUIT foo"
assert_request :command => "QUIT", :args => [""], :text => "", :line => "QUIT :"
end
@@ -22,7 +22,7 @@ def teardown
first = create_session("first")
second = create_session("second")
assert_equal ["first", "second"], session_names
-
+
first.destroy
assert_equal ["second"], session_names
end

0 comments on commit 7915e01

Please sign in to comment.