chiketto 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 331a8eefccab238030f3f28d733b29f0b0016cff
4
- data.tar.gz: cfa1d0d73e113761ecac8ffe609405f3aa9fdc74
3
+ metadata.gz: d23593990a24a172ea34bac159a227002c896396
4
+ data.tar.gz: 4867c5aaad91c175355e671906ac8dae68c0aefd
5
5
  SHA512:
6
- metadata.gz: cd740985cffa0dba4ffc242e4b9714e820520d7433a6364d7269149b98b623b601cb55fc7bc0d7317f37867fa027966ce64887ee4bc24bea566b9e0f0b2e6f50
7
- data.tar.gz: 6585a529b989485e81a613f7c738a2d67306d2993748868a8be666ddf5d5f280a3b68442e4cf90c7a45ecdc4f0d523167897fc0fba3bebb1394143dc1371d0e8
6
+ metadata.gz: 85b4105891effca2662857e1c9635268075f1ff81e27837765fd5d993ccc133e4809d1028bc168f921c430cded253768382fa73c64d24e3d39c46aac47179a17
7
+ data.tar.gz: a49e03127c0b8c4332bf2e6d52bea5724e419bd46506c61a81ff5b96aac5506c2785e1592800a18d3e1e73613ec9aa4cb697b3e7e9a6e6429f3a6766c07b2e8e
data/.travis.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
- - 2.1.2
4
+ - 2.1.5
5
+ - 2.2.0
5
6
  env:
6
7
  global:
7
8
  - secure: awI4Vmf+oFJC8CToe+yZ7in2By5m290LFBhYNyMNVmZxSfSqS5eDTKOeCWltiA5bZmqEbV+lVxh7YkeBKeZFtUPiDflAXMV57pCDD/CKvThpxHMnCwOEhlBu6GbBbCXAvs+2oPtkIYRpkDaAwFPrUcNrnVwCrdLp7zaXgjpxC8Q=
@@ -3,6 +3,7 @@ module Chiketto
3
3
  attr_accessor :text, :html
4
4
 
5
5
  def initialize(hash = {})
6
+ hash ||= {}
6
7
  @text = hash.fetch('text') { '' }
7
8
  @html = hash.fetch('html') { @text }
8
9
  end
@@ -8,6 +8,8 @@ module Chiketto
8
8
  response = Organizer.post 'organizer_new', params
9
9
  if response.fetch('process', false)
10
10
  response['process']['id']
11
+ elsif response.fetch('error', false)
12
+ raise response['error']['error_message']
11
13
  end
12
14
  end
13
15
  end
@@ -1,3 +1,3 @@
1
1
  module Chiketto
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -27,4 +27,10 @@ class AttributeTest < MiniTest::Test
27
27
  attrib = Chiketto::Attribute.new
28
28
  assert_equal '', attrib.text
29
29
  end
30
+
31
+ def test_attribute_handles_nil_correctly
32
+ attrib = Chiketto::Attribute.new nil
33
+ assert_equal '', attrib.text
34
+ assert_equal '', attrib.html
35
+ end
30
36
  end
@@ -3,10 +3,10 @@ require 'test_helper'
3
3
  class OrganizerTest < MiniTest::Test
4
4
  def setup
5
5
  @organizer = Chiketto::Organizer.new 'description' => {
6
- 'text' => 'Description of the Example Organizer',
6
+ 'text' => 'Description of the Example Organizer',
7
7
  'html' => '<p>Description of the Example Organizer</p>'
8
- },
9
- 'id' => '1667263718',
8
+ },
9
+ 'id' => '1667263718',
10
10
  'name' => 'Example Organizer'
11
11
  end
12
12
 
@@ -21,10 +21,18 @@ class OrganizerTest < MiniTest::Test
21
21
  assert_respond_to @organizer.description, :text
22
22
  end
23
23
 
24
- def test_can_create_new_organizer
24
+ # def test_can_create_new_organizer
25
+ # VCR.use_cassette 'organizer-create-new' do
26
+ # organizer = Chiketto::Organizer.create name: 'New Organizer'
27
+ # assert_kind_of Fixnum, organizer
28
+ # end
29
+ # end
30
+
31
+ def test_cannot_create_an_existing_organizer
25
32
  VCR.use_cassette 'organizer-create' do
26
- organizer = Chiketto::Organizer.create name: 'Test Organizer'
27
- assert_kind_of Fixnum, organizer
33
+ assert_raises RuntimeError do
34
+ Chiketto::Organizer.create name: 'Test Organizer'
35
+ end
28
36
  end
29
37
  end
30
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chiketto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Radford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-07 00:00:00.000000000 Z
11
+ date: 2015-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler