dropio 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +3 -0
- data/LICENSE.txt +19 -0
- data/Manifest +22 -0
- data/Rakefile +62 -0
- data/Readme.rdoc +17 -0
- data/Todo.rdoc +5 -0
- data/dropio.gemspec +34 -0
- data/lib/dropio/asset.rb +60 -0
- data/lib/dropio/client/mapper.rb +47 -0
- data/lib/dropio/client/multipart_post.rb +35 -0
- data/lib/dropio/client.rb +321 -0
- data/lib/dropio/comment.rb +15 -0
- data/lib/dropio/drop.rb +54 -0
- data/lib/dropio/resource.rb +9 -0
- data/lib/dropio.rb +35 -0
- data/spec/dropio/asset_spec.rb +59 -0
- data/spec/dropio/client/mapper_spec.rb +169 -0
- data/spec/dropio/client_spec.rb +322 -0
- data/spec/dropio/comment_spec.rb +23 -0
- data/spec/dropio/drop_spec.rb +24 -0
- data/spec/dropio_spec.rb +8 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +42 -0
- metadata +93 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe Comment do
|
4
|
+
before(:each) do
|
5
|
+
@comment = Comment.new
|
6
|
+
@client = stub(Client)
|
7
|
+
Client.stub!(:instance).and_return(@client)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should have the attributes of an Comment" do
|
11
|
+
@comment.should respond_to(:id, :contents, :created_at)
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should save itself" do
|
15
|
+
@client.should_receive(:save_comment).with(@comment)
|
16
|
+
@comment.save
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should destroy itself" do
|
20
|
+
@client.should_receive(:destroy_comment).with(@comment)
|
21
|
+
@comment.destroy
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper.rb'
|
2
|
+
|
3
|
+
describe Drop do
|
4
|
+
it "should have the attributes of a Drop" do
|
5
|
+
Drop.new.should respond_to(:name, :email, :voicemail, :conference, :fax,
|
6
|
+
:rss, :guest_token, :admin_token,
|
7
|
+
:expiration_length, :guests_can_comment, :guests_can_comment,
|
8
|
+
:guests_can_delete, :max_bytes,
|
9
|
+
:current_bytes, :hidden_upload_url,
|
10
|
+
:upload_url, :password, :admin_password, :premium_code)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should find drops by name" do
|
14
|
+
mydrop = stub(Drop)
|
15
|
+
Client.instance.should_receive(:find_drop).with("mydrop", nil).and_return(mydrop)
|
16
|
+
Drop.find("mydrop").should == mydrop
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should find drops by name and token" do
|
20
|
+
mydrop = stub(Drop)
|
21
|
+
Client.instance.should_receive(:find_drop).with("mydrop", "d85a6").and_return(mydrop)
|
22
|
+
Drop.find("mydrop", "d85a6").should == mydrop
|
23
|
+
end
|
24
|
+
end
|
data/spec/dropio_spec.rb
ADDED
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spec'
|
3
|
+
|
4
|
+
lib_dir = File.dirname(__FILE__) + '/../lib'
|
5
|
+
$:.unshift lib_dir unless $:.include?(lib_dir)
|
6
|
+
|
7
|
+
require 'dropio'
|
8
|
+
include Dropio
|
9
|
+
|
10
|
+
module Enumerable
|
11
|
+
# Apply an expectation to each object in the collection.
|
12
|
+
def each_should(*args)
|
13
|
+
each {|item| item.should(*args)}
|
14
|
+
end
|
15
|
+
|
16
|
+
# Apply a negative expectation to each object in the collection.
|
17
|
+
def each_should_not(*args)
|
18
|
+
each {|item| item.should_not(*args)}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Make class mocks and stubs pretend to belong to their given class.
|
23
|
+
module Spec::Mocks
|
24
|
+
class Mock
|
25
|
+
def kind_of?(klass)
|
26
|
+
if @name.kind_of?(Class) and @name <= klass
|
27
|
+
true
|
28
|
+
else
|
29
|
+
super
|
30
|
+
end
|
31
|
+
end
|
32
|
+
alias is_a? kind_of?
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# Reimplement Module#=== in Ruby. Without this, === bypasses message
|
37
|
+
# dispatch, so the trick above doesn't wouldn't apply to case statements.
|
38
|
+
class Module
|
39
|
+
def ===(arg)
|
40
|
+
arg.kind_of?(self)
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dropio
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jake Good, Peter Jaros
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-11-10 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: echoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
description: A Ruby client library for the Drop.io API (http://api.drop.io)
|
26
|
+
email:
|
27
|
+
- jake@dropio.com
|
28
|
+
- peeja@dropio.com
|
29
|
+
executables: []
|
30
|
+
|
31
|
+
extensions: []
|
32
|
+
|
33
|
+
extra_rdoc_files:
|
34
|
+
- History.rdoc
|
35
|
+
- Readme.rdoc
|
36
|
+
- Todo.rdoc
|
37
|
+
files:
|
38
|
+
- History.rdoc
|
39
|
+
- lib/dropio/asset.rb
|
40
|
+
- lib/dropio/client/mapper.rb
|
41
|
+
- lib/dropio/client/multipart_post.rb
|
42
|
+
- lib/dropio/client.rb
|
43
|
+
- lib/dropio/comment.rb
|
44
|
+
- lib/dropio/drop.rb
|
45
|
+
- lib/dropio/resource.rb
|
46
|
+
- lib/dropio.rb
|
47
|
+
- LICENSE.txt
|
48
|
+
- Manifest
|
49
|
+
- Rakefile
|
50
|
+
- Readme.rdoc
|
51
|
+
- spec/dropio/asset_spec.rb
|
52
|
+
- spec/dropio/client/mapper_spec.rb
|
53
|
+
- spec/dropio/client_spec.rb
|
54
|
+
- spec/dropio/comment_spec.rb
|
55
|
+
- spec/dropio/drop_spec.rb
|
56
|
+
- spec/dropio_spec.rb
|
57
|
+
- spec/spec.opts
|
58
|
+
- spec/spec_helper.rb
|
59
|
+
- Todo.rdoc
|
60
|
+
- dropio.gemspec
|
61
|
+
has_rdoc: true
|
62
|
+
homepage: http://github.com/whoisjake/dropio_api_ruby
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options:
|
65
|
+
- --line-numbers
|
66
|
+
- --inline-source
|
67
|
+
- --title
|
68
|
+
- Dropio
|
69
|
+
- --main
|
70
|
+
- Readme.rdoc
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: "0"
|
78
|
+
version:
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: "1.2"
|
84
|
+
version:
|
85
|
+
requirements: []
|
86
|
+
|
87
|
+
rubyforge_project: dropio
|
88
|
+
rubygems_version: 1.3.0
|
89
|
+
signing_key:
|
90
|
+
specification_version: 2
|
91
|
+
summary: A Ruby client library for the Drop.io API (http://api.drop.io)
|
92
|
+
test_files: []
|
93
|
+
|