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 CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gyazz
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/lib/gyazz/wiki.rb CHANGED
@@ -36,6 +36,7 @@ module Gyazz
36
36
  end
37
37
 
38
38
  def post(path, opts)
39
+ opts[:basic_auth] = @basic_auth if @basic_auth
39
40
  res = HTTParty.post "#{@host}#{path}", opts
40
41
  case res.code
41
42
  when 200
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gyazz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: