executrix 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,64 @@
1
+ #encoding: utf-8
2
+ require 'spec_helper'
3
+
4
+ describe Executrix::Api do
5
+ let(:empty_connection) do
6
+ Executrix::Connection.new(nil, nil, nil, nil)
7
+ end
8
+
9
+ let(:empty_batch) do
10
+ Object.new
11
+ end
12
+
13
+ {
14
+ upsert: 3,
15
+ update: 2,
16
+ insert: 2,
17
+ delete: 2,
18
+ }.each do |method_name, num_of_params|
19
+ describe "##{method_name}" do
20
+ it 'should delegate to #start_job' do
21
+ Executrix::Connection.
22
+ should_receive(:connect).
23
+ and_return(empty_connection)
24
+ s = described_class.new(nil, nil)
25
+ s.should_receive(:start_job).
26
+ with(method_name.to_s, *Array.new(num_of_params))
27
+ s.send(method_name, *Array.new(num_of_params))
28
+ end
29
+
30
+ it 'should trigger correct workflow' do
31
+ Executrix::Connection.
32
+ should_receive(:connect).
33
+ and_return(empty_connection)
34
+ s = described_class.new(nil, nil)
35
+ empty_connection.should_receive(:create_job).ordered
36
+ empty_connection.should_receive(:add_batch).ordered
37
+ empty_connection.should_receive(:close_job).ordered
38
+ res = s.send(method_name, *Array.new(num_of_params))
39
+ expect(res).to be_a(Executrix::Batch)
40
+ end
41
+ end
42
+ end
43
+
44
+ describe '#query' do
45
+ it 'should trigger correct workflow' do
46
+ Executrix::Connection.
47
+ should_receive(:connect).
48
+ and_return(empty_connection)
49
+ Executrix::Batch.
50
+ should_receive(:new).
51
+ and_return(empty_batch)
52
+
53
+ s = described_class.new(nil, nil)
54
+ sobject_input = 'sobject_stub'
55
+ query_input = 'query_stub'
56
+ empty_connection.should_receive(:create_job).ordered
57
+ empty_connection.should_receive(:add_query).ordered
58
+ empty_connection.should_receive(:close_job).ordered
59
+ empty_batch.should_receive(:init_result_id).ordered
60
+ empty_batch.should_receive(:final_status).ordered
61
+ s.query(sobject_input, query_input)
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,16 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+
4
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
5
+ SimpleCov.start do
6
+ add_filter 'spec'
7
+ end
8
+
9
+ require 'executrix'
10
+ require 'webmock/rspec'
11
+
12
+ RSpec.configure do |config|
13
+ config.mock_with :rspec
14
+ config.order = 'random'
15
+ config.filter_run_excluding skip: true
16
+ end
metadata ADDED
@@ -0,0 +1,142 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: executrix
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jorge Valdivia
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: nori
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.13'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '2.13'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: '1.11'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.11'
83
+ description: This gem provides a super simple interface for the Salesforce Bulk API.
84
+ It provides support for insert, update, upsert, delete, and query.
85
+ email:
86
+ - jorge@valdivia.me
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - .gitignore
92
+ - .rspec
93
+ - .ruby-version
94
+ - .travis.yml
95
+ - Gemfile
96
+ - Guardfile
97
+ - LICENSE
98
+ - README.md
99
+ - Rakefile
100
+ - executrix.gemspec
101
+ - lib/executrix.rb
102
+ - lib/executrix/batch.rb
103
+ - lib/executrix/connection.rb
104
+ - lib/executrix/helper.rb
105
+ - lib/executrix/http.rb
106
+ - lib/executrix/version.rb
107
+ - spec/lib/executrix/batch_spec.rb
108
+ - spec/lib/executrix/connection_spec.rb
109
+ - spec/lib/executrix/helper_spec.rb
110
+ - spec/lib/executrix/http_spec.rb
111
+ - spec/lib/executrix_spec.rb
112
+ - spec/spec_helper.rb
113
+ homepage: https://github.com/propertybase/executrix
114
+ licenses: []
115
+ metadata: {}
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ! '>='
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubyforge_project: executrix
132
+ rubygems_version: 2.0.0
133
+ signing_key:
134
+ specification_version: 4
135
+ summary: Ruby support for the Salesforce Bulk API
136
+ test_files:
137
+ - spec/lib/executrix/batch_spec.rb
138
+ - spec/lib/executrix/connection_spec.rb
139
+ - spec/lib/executrix/helper_spec.rb
140
+ - spec/lib/executrix/http_spec.rb
141
+ - spec/lib/executrix_spec.rb
142
+ - spec/spec_helper.rb