gyazz 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gyazz/version.rb +1 -1
- data/lib/gyazz/wiki.rb +1 -0
- data/test/test_auth.rb +19 -0
- metadata +1 -1
data/lib/gyazz/version.rb
CHANGED
data/lib/gyazz/wiki.rb
CHANGED
data/test/test_auth.rb
CHANGED
@@ -26,4 +26,23 @@ class TestWikiAuth < MiniTest::Test
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def test_auth_page_get_fail
|
30
|
+
page = @wiki.page('aaa')
|
31
|
+
err = nil
|
32
|
+
begin
|
33
|
+
page.text
|
34
|
+
rescue => e
|
35
|
+
err = e
|
36
|
+
end
|
37
|
+
assert_equal err.class, Gyazz::Error
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_auth_page_get_set
|
41
|
+
@wiki.auth = {:username => 'test_username', :password => 'test_password'}
|
42
|
+
page = @wiki.page('aaa')
|
43
|
+
body = ["foo", "bar", Time.now.to_s].join("\n")
|
44
|
+
page.text = body
|
45
|
+
assert_equal page.text.strip, body
|
46
|
+
end
|
47
|
+
|
29
48
|
end
|