onlinebrief24 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -170,7 +170,7 @@ end
170
170
 
171
171
  ### Ausprobieren / Keine Funktionsgarantie!
172
172
 
173
- Onlinebrief24 räumt jedem Neukunden ein Guthaben von 5 EUR ein. Es wird empfohlen die Benutzung dieses rubygems damit zu testen. Die vorhandenen Tests (RSpec) im ```spec```-Verzeichnis können dies nicht ersetzen!
173
+ Onlinebrief24 räumt aktuell (Stand Januar 2013) jedem Neukunden ein Guthaben von 5 EUR ein. Es wird empfohlen die Benutzung dieses rubygems damit zu testen. Die vorhandenen Tests (RSpec) im ```spec```-Verzeichnis können dies nicht ersetzen!
174
174
 
175
175
 
176
176
  ### Fehler? Probleme? Patches?
@@ -45,8 +45,7 @@ module Onlinebrief24
45
45
  alias_method :connect, :connection
46
46
 
47
47
  def disconnect
48
- puts "disconnecting"
49
- @connection.close if @connection and @connection.open?
48
+ @connection.session.close if @connection and @connection.open?
50
49
  end
51
50
 
52
51
  def abs_remote_path(filename)
@@ -1,3 +1,3 @@
1
1
  module Onlinebrief24
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
@@ -89,15 +89,18 @@ describe Onlinebrief24::Client do
89
89
  it 'should maintain the connection state' do
90
90
  # re-used connection
91
91
  connection = double('connection')
92
- connection.should_receive(:open?).twice { true }
92
+ connection.should_receive(:open?).exactly(3).times { true }
93
93
  connection.should_receive(:upload!).exactly(3).times
94
94
 
95
+ # disconnect when block closes
96
+ ssh_session = double('ssh-session')
97
+ ssh_session.should_receive(:close).once
98
+
99
+ connection.stub(:session).and_return(ssh_session)
100
+
95
101
  # connect on first demand
96
102
  Net::SFTP.should_receive(:start).once { connection }
97
103
 
98
- # disconnect when block closes
99
- Onlinebrief24::Client.any_instance.should_receive(:disconnect).once
100
-
101
104
  Onlinebrief24::Client.new(params) do |client|
102
105
  client.upload!(local_path, :color => true)
103
106
  client.upload!(local_path, :color => true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onlinebrief24
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-15 00:00:00.000000000 Z
12
+ date: 2013-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-sftp
@@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  segments:
150
150
  - 0
151
- hash: -56571769826084525
151
+ hash: 775032794584312131
152
152
  required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  none: false
154
154
  requirements:
@@ -157,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  version: '0'
158
158
  segments:
159
159
  - 0
160
- hash: -56571769826084525
160
+ hash: 775032794584312131
161
161
  requirements: []
162
162
  rubyforge_project:
163
163
  rubygems_version: 1.8.23