groupdocs 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -50,7 +50,10 @@ module GroupDocs
50
50
  # @param [Hash] options
51
51
  #
52
52
  define_method(:"#{method}=") do |options|
53
- instance_variable_set(:"@#{method}", User.new(options)) if options
53
+ case options
54
+ when GroupDocs::User then instance_variable_set(:"@#{method}", options)
55
+ when Hash then instance_variable_set(:"@#{method}", User.new(options))
56
+ end
54
57
  end
55
58
  end
56
59
 
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '0.3.6'
2
+ VERSION = '0.3.7'
3
3
  end # GroupDocs
@@ -18,22 +18,40 @@ describe GroupDocs::Questionnaire::Execution do
18
18
  end
19
19
  end
20
20
 
21
- it { should respond_to(:id) }
22
- it { should respond_to(:id=) }
23
- it { should respond_to(:questionnaire_id) }
24
- it { should respond_to(:questionnaire_id=) }
25
- it { should respond_to(:owner) }
26
- it { should respond_to(:owner=) }
27
- it { should respond_to(:executive) }
28
- it { should respond_to(:executive=) }
29
- it { should respond_to(:approver) }
30
- it { should respond_to(:approver=) }
31
- it { should respond_to(:datasource_id) }
32
- it { should respond_to(:datasource_id=) }
33
- it { should respond_to(:status) }
34
- it { should respond_to(:status=) }
35
- it { should respond_to(:guid) }
36
- it { should respond_to(:guid=) }
21
+ it { should respond_to(:id) }
22
+ it { should respond_to(:id=) }
23
+ it { should respond_to(:questionnaire_id) }
24
+ it { should respond_to(:questionnaire_id=) }
25
+ it { should respond_to(:questionnaire_name) }
26
+ it { should respond_to(:questionnaire_name=) }
27
+ it { should respond_to(:owner) }
28
+ it { should respond_to(:owner=) }
29
+ it { should respond_to(:executive) }
30
+ it { should respond_to(:executive=) }
31
+ it { should respond_to(:approver) }
32
+ it { should respond_to(:approver=) }
33
+ it { should respond_to(:datasource_id) }
34
+ it { should respond_to(:datasource_id=) }
35
+ it { should respond_to(:status) }
36
+ it { should respond_to(:status=) }
37
+ it { should respond_to(:guid) }
38
+ it { should respond_to(:guid=) }
39
+
40
+ %w(owner executive approver).each do |method|
41
+ describe "##{method}=" do
42
+ it 'converts passed hash to GroupDocs::User object' do
43
+ subject.send(:"#{method}=", { first_name: 'Test' })
44
+ user = subject.send(:"#{method}")
45
+ user.should be_a(GroupDocs::User)
46
+ user.first_name.should == 'Test'
47
+ end
48
+
49
+ it 'does nothing if GroupDocs::User is passed' do
50
+ subject.send(:"#{method}=", GroupDocs::User.new(first_name: 'Test'))
51
+ subject.send(:"#{method}").first_name.should == 'Test'
52
+ end
53
+ end
54
+ end
37
55
 
38
56
  describe '#set_status!' do
39
57
  before(:each) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-25 00:00:00.000000000 Z
12
+ date: 2012-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &12447860 !ruby/object:Gem::Requirement
16
+ requirement: &17627180 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.6'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *12447860
24
+ version_requirements: *17627180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &12462460 !ruby/object:Gem::Requirement
27
+ requirement: &17641880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.7'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *12462460
35
+ version_requirements: *17641880
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ruby-hmac
38
- requirement: &12461140 !ruby/object:Gem::Requirement
38
+ requirement: &17640500 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *12461140
46
+ version_requirements: *17640500
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &12459460 !ruby/object:Gem::Requirement
49
+ requirement: &17638840 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '2.9'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *12459460
57
+ version_requirements: *17638840
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rake
60
- requirement: &12458440 !ruby/object:Gem::Requirement
60
+ requirement: &17637840 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0.9'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *12458440
68
+ version_requirements: *17637840
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &12457540 !ruby/object:Gem::Requirement
71
+ requirement: &17636920 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0.6'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *12457540
79
+ version_requirements: *17636920
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: yard
82
- requirement: &12470580 !ruby/object:Gem::Requirement
82
+ requirement: &17650020 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0.8'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *12470580
90
+ version_requirements: *17650020
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &12468260 !ruby/object:Gem::Requirement
93
+ requirement: &17647300 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: '1.8'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *12468260
101
+ version_requirements: *17647300
102
102
  description: Ruby SDK for GroupDocs REST API
103
103
  email: p0deje@gmail.com
104
104
  executables: []
@@ -256,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
256
256
  version: '0'
257
257
  segments:
258
258
  - 0
259
- hash: 2406199211675582739
259
+ hash: 3735999314178222013
260
260
  required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  none: false
262
262
  requirements:
@@ -265,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  segments:
267
267
  - 0
268
- hash: 2406199211675582739
268
+ hash: 3735999314178222013
269
269
  requirements: []
270
270
  rubyforge_project:
271
271
  rubygems_version: 1.8.10