elibri_onix_mocks 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
 
21
21
  # specify any dependencies here; for example:
22
22
  s.add_development_dependency "rspec"
23
- s.add_development_dependency 'ruby-debug'
23
+ # s.add_development_dependency 'ruby-debug'
24
24
  s.add_development_dependency 'rake'
25
25
 
26
26
  # s.add_runtime_dependency "rest-client"
@@ -808,6 +808,34 @@ module Elibri
808
808
  end.extend(MockMethodMissing)
809
809
  end
810
810
 
811
+ def product_attachment_mock(options = {})
812
+ opt =
813
+ {
814
+ :id => 668,
815
+ :attachment_type_code => Elibri::ONIX::Dict::Release_3_0::ResourceContentType::FRONT_COVER,
816
+ :file_content_type => 'image/png',
817
+ :onix_resource_mode => Elibri::ONIX::Dict::Release_3_0::ResourceMode::IMAGE,
818
+ :file => paperclip_attachment_mock,
819
+ :updated_at => Date.new(2011, 12, 01).to_time + 19.hours + 5.minutes + 28.seconds
820
+ }.merge(options)
821
+ mock('ProductAttachment').tap do |att|
822
+ att.stubs(
823
+ opt
824
+ )
825
+ end.extend(MockMethodMissing)
826
+ end
827
+
828
+ def paperclip_attachment_mock(options = {})
829
+ opt = {
830
+ :url => 'http://elibri.com.pl/sciezka/do/pliku.png'
831
+ }.merge(options)
832
+ mock('Paperclip::Attachment').tap do |paperclip|
833
+ paperclip.stubs(
834
+ opt
835
+ )
836
+ end.extend(MockMethodMissing)
837
+ end
838
+
811
839
  def product_with_similars_mock(options = {})
812
840
  product_1 = Elibri::XmlMocks::Examples.book_example(:title => 'title_1')
813
841
  product_2 = Elibri::XmlMocks::Examples.book_example(:title => 'title_2', :isbn_value => '9788324799993', :record_reference => 'fdb8fa072be774d97a98')
@@ -1,3 +1,3 @@
1
1
  module ElibriOnixMocks
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -19,7 +19,7 @@ describe Elibri::XmlMocks::Examples do
19
19
  # :onix_related_products_example, #temporarly disabled
20
20
  :onix_supply_details_example, :onix_series_memberships_example, :onix_supporting_resources_example,
21
21
  :onix_elibri_extensions_example, :contributor_mock, :review_mock, :supply_detail_mock, :imprint_mock,
22
- :description_mock
22
+ :description_mock, :product_attachment_mock, :paperclip_attachment_mock
23
23
  ].each do |symbol|
24
24
 
25
25
  it "should create #{symbol} xml and parse it properly" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix_mocks
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 4
10
- version: 0.1.4
9
+ - 5
10
+ version: 0.1.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Piotr Szmielew
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-17 00:00:00 Z
18
+ date: 2012-05-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec
@@ -32,7 +32,7 @@ dependencies:
32
32
  type: :development
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- name: ruby-debug
35
+ name: rake
36
36
  prerelease: false
37
37
  requirement: &id002 !ruby/object:Gem::Requirement
38
38
  none: false
@@ -46,7 +46,7 @@ dependencies:
46
46
  type: :development
47
47
  version_requirements: *id002
48
48
  - !ruby/object:Gem::Dependency
49
- name: rake
49
+ name: elibri_onix
50
50
  prerelease: false
51
51
  requirement: &id003 !ruby/object:Gem::Requirement
52
52
  none: false
@@ -57,10 +57,10 @@ dependencies:
57
57
  segments:
58
58
  - 0
59
59
  version: "0"
60
- type: :development
60
+ type: :runtime
61
61
  version_requirements: *id003
62
62
  - !ruby/object:Gem::Dependency
63
- name: elibri_onix
63
+ name: elibri_onix_generator
64
64
  prerelease: false
65
65
  requirement: &id004 !ruby/object:Gem::Requirement
66
66
  none: false
@@ -74,7 +74,7 @@ dependencies:
74
74
  type: :runtime
75
75
  version_requirements: *id004
76
76
  - !ruby/object:Gem::Dependency
77
- name: elibri_onix_generator
77
+ name: elibri_onix_dict
78
78
  prerelease: false
79
79
  requirement: &id005 !ruby/object:Gem::Requirement
80
80
  none: false
@@ -88,7 +88,7 @@ dependencies:
88
88
  type: :runtime
89
89
  version_requirements: *id005
90
90
  - !ruby/object:Gem::Dependency
91
- name: elibri_onix_dict
91
+ name: elibri_api_client
92
92
  prerelease: false
93
93
  requirement: &id006 !ruby/object:Gem::Requirement
94
94
  none: false
@@ -102,7 +102,7 @@ dependencies:
102
102
  type: :runtime
103
103
  version_requirements: *id006
104
104
  - !ruby/object:Gem::Dependency
105
- name: elibri_api_client
105
+ name: mocha
106
106
  prerelease: false
107
107
  requirement: &id007 !ruby/object:Gem::Requirement
108
108
  none: false
@@ -116,7 +116,7 @@ dependencies:
116
116
  type: :runtime
117
117
  version_requirements: *id007
118
118
  - !ruby/object:Gem::Dependency
119
- name: mocha
119
+ name: builder
120
120
  prerelease: false
121
121
  requirement: &id008 !ruby/object:Gem::Requirement
122
122
  none: false
@@ -130,7 +130,7 @@ dependencies:
130
130
  type: :runtime
131
131
  version_requirements: *id008
132
132
  - !ruby/object:Gem::Dependency
133
- name: builder
133
+ name: activesupport
134
134
  prerelease: false
135
135
  requirement: &id009 !ruby/object:Gem::Requirement
136
136
  none: false
@@ -143,20 +143,6 @@ dependencies:
143
143
  version: "0"
144
144
  type: :runtime
145
145
  version_requirements: *id009
146
- - !ruby/object:Gem::Dependency
147
- name: activesupport
148
- prerelease: false
149
- requirement: &id010 !ruby/object:Gem::Requirement
150
- none: false
151
- requirements:
152
- - - ">="
153
- - !ruby/object:Gem::Version
154
- hash: 3
155
- segments:
156
- - 0
157
- version: "0"
158
- type: :runtime
159
- version_requirements: *id010
160
146
  description: "Usage: Elibri::XmlGenerator.basic_product etc"
161
147
  email:
162
148
  - p.szmielew@ava.waw.pl