pandexio 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ module Pandexio
2
+
3
+ class Document
4
+
5
+ def initialize(params = {})
6
+ @document_id = params.fetch(:document_id, nil)
7
+ @name = params.fetch(:name, nil)
8
+ @page_count = params.fetch(:page_count, nil)
9
+ @content_type = params.fetch(:content_type, nil)
10
+ @content_length = params.fetch(:content_length, nil)
11
+ @cover = params.fetch(:cover, nil)
12
+ end
13
+
14
+ attr_accessor :document_id
15
+ attr_accessor :name
16
+ attr_accessor :page_count
17
+ attr_accessor :content_type
18
+ attr_accessor :content_length
19
+ attr_accessor :cover
20
+
21
+ end
22
+
23
+ end
@@ -0,0 +1,19 @@
1
+ module Pandexio
2
+
3
+ class DocumentSource
4
+
5
+ def initialize(params = {})
6
+ @id = params.fetch(:id, nil)
7
+ @name = params.fetch(:name, nil)
8
+ @content = params.fetch(:content, nil)
9
+ @location = params.fetch(:location, nil)
10
+ end
11
+
12
+ attr_accessor :id
13
+ attr_accessor :name
14
+ attr_accessor :content
15
+ attr_accessor :location
16
+
17
+ end
18
+
19
+ end
data/lib/http_client.rb CHANGED
@@ -3,53 +3,21 @@ require 'json'
3
3
  require 'stringio'
4
4
  require 'open-uri'
5
5
  require_relative 'request.rb'
6
- require_relative 'scope_patterns.rb'
6
+ require_relative 'signing_options.rb'
7
7
  require_relative 'signer.rb'
8
+ require_relative 'scope_patterns.rb'
9
+ require_relative 'signing_algorithms.rb'
8
10
  require_relative 'signing_mechanisms.rb'
11
+ require_relative 'ent/document_source.rb'
12
+ require_relative 'ent/document.rb'
9
13
 
10
14
  module Pandexio
11
15
 
12
- HOSTED_HOST = "hosted.pandexio.com"
13
- PLATFORM_HOST = "platform.pandexio.com"
14
-
15
- class DocumentSource
16
-
17
- def initialize(params = {})
18
- @id = params.fetch(:id, nil)
19
- @name = params.fetch(:name, nil)
20
- @content = params.fetch(:content, nil)
21
- @location = params.fetch(:location, nil)
22
- end
23
-
24
- attr_accessor :id
25
- attr_accessor :name
26
- attr_accessor :content
27
- attr_accessor :location
28
-
29
- end
30
-
31
- class Document
32
-
33
- def initialize(params = {})
34
- @document_id = params.fetch(:document_id, nil)
35
- @name = params.fetch(:name, nil)
36
- @page_count = params.fetch(:page_count, nil)
37
- @content_type = params.fetch(:content_type, nil)
38
- @content_length = params.fetch(:content_length, nil)
39
- @cover = params.fetch(:cover, nil)
40
- end
41
-
42
- attr_accessor :document_id
43
- attr_accessor :name
44
- attr_accessor :page_count
45
- attr_accessor :content_type
46
- attr_accessor :content_length
47
- attr_accessor :cover
48
-
49
- end
50
-
51
16
  class HttpClient
52
17
 
18
+ HOSTED_HOST = "hosted.pandexio.com"
19
+ PLATFORM_HOST = "platform.pandexio.com"
20
+
53
21
  private
54
22
 
55
23
  def build_headers(headers, content_type)
@@ -1,18 +1,15 @@
1
1
  # encoding: utf-8
2
2
 
3
+ require 'minitest/autorun'
3
4
  require 'time'
4
5
  require 'uuid'
5
- require 'minitest/autorun'
6
- #require 'pandexio'
7
- require_relative 'test_config.rb'
8
- require_relative '../lib/http_client.rb'
9
- require_relative '../lib/scope_patterns.rb'
10
- require_relative '../lib/signing_options.rb'
11
- require_relative '../lib/signing_algorithms.rb'
12
- require_relative '../lib/signing_mechanisms.rb'
6
+ require "pandexio"
13
7
 
14
- describe Pandexio::HttpClient do
8
+ SKIP_INTEGRATION_TESTS = true
9
+ DOMAIN_ID = "<domain_id>"
10
+ DOMAIN_KEY = "<domain_key>"
15
11
 
12
+ describe Pandexio::HttpClient do
16
13
  describe "#load_document" do
17
14
 
18
15
  describe "when id is nil" do
@@ -242,7 +239,7 @@ describe Pandexio::HttpClient do
242
239
  describe "when content is data URL" do
243
240
 
244
241
  before do
245
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
242
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
246
243
  @id = UUID.new.generate
247
244
  document_source = Pandexio::DocumentSource.new(
248
245
  :id => @id,
@@ -252,8 +249,8 @@ describe Pandexio::HttpClient do
252
249
  signing_options = Pandexio::SigningOptions.new(
253
250
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
254
251
  :mechanism => Pandexio::SigningMechanisms::HEADER,
255
- :domain_id => TestConfig::DOMAIN_ID,
256
- :domain_key => TestConfig::DOMAIN_KEY,
252
+ :domain_id => DOMAIN_ID,
253
+ :domain_key => DOMAIN_KEY,
257
254
  :date => Time.now.utc,
258
255
  :expires => 90,
259
256
  :originator => "HttpClientTest",
@@ -279,7 +276,7 @@ describe Pandexio::HttpClient do
279
276
  describe "when content is HTTP URL" do
280
277
 
281
278
  before do
282
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
279
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
283
280
  @id = UUID.new.generate
284
281
  document_source = Pandexio::DocumentSource.new(
285
282
  :id => @id,
@@ -289,8 +286,8 @@ describe Pandexio::HttpClient do
289
286
  signing_options = Pandexio::SigningOptions.new(
290
287
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
291
288
  :mechanism => Pandexio::SigningMechanisms::HEADER,
292
- :domain_id => TestConfig::DOMAIN_ID,
293
- :domain_key => TestConfig::DOMAIN_KEY,
289
+ :domain_id => DOMAIN_ID,
290
+ :domain_key => DOMAIN_KEY,
294
291
  :date => Time.now.utc,
295
292
  :expires => 90,
296
293
  :originator => "HttpClientTest",
@@ -410,13 +407,13 @@ describe Pandexio::HttpClient do
410
407
  describe "when document does not exist" do
411
408
 
412
409
  before do
413
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
410
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
414
411
  id = UUID.new.generate
415
412
  signing_options = Pandexio::SigningOptions.new(
416
413
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
417
414
  :mechanism => Pandexio::SigningMechanisms::HEADER,
418
- :domain_id => TestConfig::DOMAIN_ID,
419
- :domain_key => TestConfig::DOMAIN_KEY,
415
+ :domain_id => DOMAIN_ID,
416
+ :domain_key => DOMAIN_KEY,
420
417
  :date => Time.now.utc,
421
418
  :expires => 90,
422
419
  :originator => "HttpClientTest",
@@ -436,7 +433,7 @@ describe Pandexio::HttpClient do
436
433
  describe "when document exists" do
437
434
 
438
435
  before do
439
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
436
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
440
437
  @id = UUID.new.generate
441
438
  document_source = Pandexio::DocumentSource.new(
442
439
  :id => @id,
@@ -446,8 +443,8 @@ describe Pandexio::HttpClient do
446
443
  signing_options = Pandexio::SigningOptions.new(
447
444
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
448
445
  :mechanism => Pandexio::SigningMechanisms::HEADER,
449
- :domain_id => TestConfig::DOMAIN_ID,
450
- :domain_key => TestConfig::DOMAIN_KEY,
446
+ :domain_id => DOMAIN_ID,
447
+ :domain_key => DOMAIN_KEY,
451
448
  :date => Time.now.utc,
452
449
  :expires => 90,
453
450
  :originator => "HttpClientTest",
@@ -455,7 +452,6 @@ describe Pandexio::HttpClient do
455
452
  :display_name => "HttpClientTest")
456
453
  http_client = Pandexio::HttpClient.new()
457
454
  http_client.load_document(document_source, signing_options)
458
- sleep(3)
459
455
  @get_document = ->{ http_client.get_document(@id, 'm', signing_options) }
460
456
  end
461
457
 
@@ -475,7 +471,7 @@ describe Pandexio::HttpClient do
475
471
  describe "when cover size is xs" do
476
472
 
477
473
  before do
478
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
474
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
479
475
  @id = UUID.new.generate
480
476
  document_source = Pandexio::DocumentSource.new(
481
477
  :id => @id,
@@ -485,8 +481,8 @@ describe Pandexio::HttpClient do
485
481
  signing_options = Pandexio::SigningOptions.new(
486
482
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
487
483
  :mechanism => Pandexio::SigningMechanisms::HEADER,
488
- :domain_id => TestConfig::DOMAIN_ID,
489
- :domain_key => TestConfig::DOMAIN_KEY,
484
+ :domain_id => DOMAIN_ID,
485
+ :domain_key => DOMAIN_KEY,
490
486
  :date => Time.now.utc,
491
487
  :expires => 90,
492
488
  :originator => "HttpClientTest",
@@ -494,7 +490,6 @@ describe Pandexio::HttpClient do
494
490
  :display_name => "HttpClientTest")
495
491
  http_client = Pandexio::HttpClient.new()
496
492
  http_client.load_document(document_source, signing_options)
497
- sleep(3)
498
493
  @get_document = ->{ http_client.get_document(@id, 'xs', signing_options) }
499
494
  end
500
495
 
@@ -608,13 +603,13 @@ describe Pandexio::HttpClient do
608
603
  describe "when document does not exist" do
609
604
 
610
605
  before do
611
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
606
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
612
607
  id = UUID.new.generate
613
608
  signing_options = Pandexio::SigningOptions.new(
614
609
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
615
610
  :mechanism => Pandexio::SigningMechanisms::HEADER,
616
- :domain_id => TestConfig::DOMAIN_ID,
617
- :domain_key => TestConfig::DOMAIN_KEY,
611
+ :domain_id => DOMAIN_ID,
612
+ :domain_key => DOMAIN_KEY,
618
613
  :date => Time.now.utc,
619
614
  :expires => 90,
620
615
  :originator => "HttpClientTest",
@@ -634,7 +629,7 @@ describe Pandexio::HttpClient do
634
629
  describe "when cover size is xs" do
635
630
 
636
631
  before do
637
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
632
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
638
633
  @id = UUID.new.generate
639
634
  document_source = Pandexio::DocumentSource.new(
640
635
  :id => @id,
@@ -644,8 +639,8 @@ describe Pandexio::HttpClient do
644
639
  signing_options = Pandexio::SigningOptions.new(
645
640
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
646
641
  :mechanism => Pandexio::SigningMechanisms::HEADER,
647
- :domain_id => TestConfig::DOMAIN_ID,
648
- :domain_key => TestConfig::DOMAIN_KEY,
642
+ :domain_id => DOMAIN_ID,
643
+ :domain_key => DOMAIN_KEY,
649
644
  :date => Time.now.utc,
650
645
  :expires => 90,
651
646
  :originator => "HttpClientTest",
@@ -653,7 +648,6 @@ describe Pandexio::HttpClient do
653
648
  :display_name => "HttpClientTest")
654
649
  http_client = Pandexio::HttpClient.new()
655
650
  http_client.load_document(document_source, signing_options)
656
- sleep(3)
657
651
  @get_document_cover = ->{ http_client.get_document_cover(@id, 'xs', signing_options) }
658
652
  end
659
653
 
@@ -667,7 +661,7 @@ describe Pandexio::HttpClient do
667
661
  describe "when cover size is s" do
668
662
 
669
663
  before do
670
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
664
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
671
665
  @id = UUID.new.generate
672
666
  document_source = Pandexio::DocumentSource.new(
673
667
  :id => @id,
@@ -677,8 +671,8 @@ describe Pandexio::HttpClient do
677
671
  signing_options = Pandexio::SigningOptions.new(
678
672
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
679
673
  :mechanism => Pandexio::SigningMechanisms::HEADER,
680
- :domain_id => TestConfig::DOMAIN_ID,
681
- :domain_key => TestConfig::DOMAIN_KEY,
674
+ :domain_id => DOMAIN_ID,
675
+ :domain_key => DOMAIN_KEY,
682
676
  :date => Time.now.utc,
683
677
  :expires => 90,
684
678
  :originator => "HttpClientTest",
@@ -686,7 +680,6 @@ describe Pandexio::HttpClient do
686
680
  :display_name => "HttpClientTest")
687
681
  http_client = Pandexio::HttpClient.new()
688
682
  http_client.load_document(document_source, signing_options)
689
- sleep(3)
690
683
  @get_document_cover = ->{ http_client.get_document_cover(@id, 's', signing_options) }
691
684
  end
692
685
 
@@ -700,7 +693,7 @@ describe Pandexio::HttpClient do
700
693
  describe "when cover size is m" do
701
694
 
702
695
  before do
703
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
696
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
704
697
  @id = UUID.new.generate
705
698
  document_source = Pandexio::DocumentSource.new(
706
699
  :id => @id,
@@ -710,8 +703,8 @@ describe Pandexio::HttpClient do
710
703
  signing_options = Pandexio::SigningOptions.new(
711
704
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
712
705
  :mechanism => Pandexio::SigningMechanisms::HEADER,
713
- :domain_id => TestConfig::DOMAIN_ID,
714
- :domain_key => TestConfig::DOMAIN_KEY,
706
+ :domain_id => DOMAIN_ID,
707
+ :domain_key => DOMAIN_KEY,
715
708
  :date => Time.now.utc,
716
709
  :expires => 90,
717
710
  :originator => "HttpClientTest",
@@ -719,7 +712,6 @@ describe Pandexio::HttpClient do
719
712
  :display_name => "HttpClientTest")
720
713
  http_client = Pandexio::HttpClient.new()
721
714
  http_client.load_document(document_source, signing_options)
722
- sleep(3)
723
715
  @get_document_cover = ->{ http_client.get_document_cover(@id, 'm', signing_options) }
724
716
  end
725
717
 
@@ -733,7 +725,7 @@ describe Pandexio::HttpClient do
733
725
  describe "when cover size is l" do
734
726
 
735
727
  before do
736
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
728
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
737
729
  @id = UUID.new.generate
738
730
  document_source = Pandexio::DocumentSource.new(
739
731
  :id => @id,
@@ -743,8 +735,8 @@ describe Pandexio::HttpClient do
743
735
  signing_options = Pandexio::SigningOptions.new(
744
736
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
745
737
  :mechanism => Pandexio::SigningMechanisms::HEADER,
746
- :domain_id => TestConfig::DOMAIN_ID,
747
- :domain_key => TestConfig::DOMAIN_KEY,
738
+ :domain_id => DOMAIN_ID,
739
+ :domain_key => DOMAIN_KEY,
748
740
  :date => Time.now.utc,
749
741
  :expires => 90,
750
742
  :originator => "HttpClientTest",
@@ -752,7 +744,6 @@ describe Pandexio::HttpClient do
752
744
  :display_name => "HttpClientTest")
753
745
  http_client = Pandexio::HttpClient.new()
754
746
  http_client.load_document(document_source, signing_options)
755
- sleep(3)
756
747
  @get_document_cover = ->{ http_client.get_document_cover(@id, 'l', signing_options) }
757
748
  end
758
749
 
@@ -766,7 +757,7 @@ describe Pandexio::HttpClient do
766
757
  describe "when cover size is xl" do
767
758
 
768
759
  before do
769
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
760
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
770
761
  @id = UUID.new.generate
771
762
  document_source = Pandexio::DocumentSource.new(
772
763
  :id => @id,
@@ -776,8 +767,8 @@ describe Pandexio::HttpClient do
776
767
  signing_options = Pandexio::SigningOptions.new(
777
768
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
778
769
  :mechanism => Pandexio::SigningMechanisms::HEADER,
779
- :domain_id => TestConfig::DOMAIN_ID,
780
- :domain_key => TestConfig::DOMAIN_KEY,
770
+ :domain_id => DOMAIN_ID,
771
+ :domain_key => DOMAIN_KEY,
781
772
  :date => Time.now.utc,
782
773
  :expires => 90,
783
774
  :originator => "HttpClientTest",
@@ -785,7 +776,6 @@ describe Pandexio::HttpClient do
785
776
  :display_name => "HttpClientTest")
786
777
  http_client = Pandexio::HttpClient.new()
787
778
  http_client.load_document(document_source, signing_options)
788
- sleep(3)
789
779
  @get_document_cover = ->{ http_client.get_document_cover(@id, 'xl', signing_options) }
790
780
  end
791
781
 
@@ -897,8 +887,8 @@ describe Pandexio::HttpClient do
897
887
  signing_options = Pandexio::SigningOptions.new(
898
888
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
899
889
  :mechanism => Pandexio::SigningMechanisms::HEADER,
900
- :domain_id => TestConfig::DOMAIN_ID,
901
- :domain_key => TestConfig::DOMAIN_KEY,
890
+ :domain_id => DOMAIN_ID,
891
+ :domain_key => DOMAIN_KEY,
902
892
  :date => Time.now.utc,
903
893
  :expires => 90,
904
894
  :originator => "HttpClientTest",
@@ -927,8 +917,8 @@ describe Pandexio::HttpClient do
927
917
  signing_options = Pandexio::SigningOptions.new(
928
918
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
929
919
  :mechanism => Pandexio::SigningMechanisms::QUERY_STRING,
930
- :domain_id => TestConfig::DOMAIN_ID,
931
- :domain_key => TestConfig::DOMAIN_KEY,
920
+ :domain_id => DOMAIN_ID,
921
+ :domain_key => DOMAIN_KEY,
932
922
  :date => Time.now.utc,
933
923
  :expires => 90,
934
924
  :originator => "HttpClientTest",
@@ -945,7 +935,7 @@ describe Pandexio::HttpClient do
945
935
  (@document_cover_url.include? "X-Pdx-EmailAddress=HttpClientTest").must_equal true
946
936
  (@document_cover_url.include? "X-Pdx-DisplayName=HttpClientTest").must_equal true
947
937
  (@document_cover_url.include? "X-Pdx-Expires=90").must_equal true
948
- (@document_cover_url.include? "X-Pdx-Credential=#{TestConfig::DOMAIN_ID}").must_equal true
938
+ (@document_cover_url.include? "X-Pdx-Credential=#{DOMAIN_ID}").must_equal true
949
939
  (@document_cover_url.include? "X-Pdx-Signature=").must_equal true
950
940
  end
951
941
 
@@ -963,8 +953,8 @@ describe Pandexio::HttpClient do
963
953
  signing_options = Pandexio::SigningOptions.new(
964
954
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
965
955
  :mechanism => Pandexio::SigningMechanisms::QUERY_STRING,
966
- :domain_id => TestConfig::DOMAIN_ID,
967
- :domain_key => TestConfig::DOMAIN_KEY,
956
+ :domain_id => DOMAIN_ID,
957
+ :domain_key => DOMAIN_KEY,
968
958
  :date => Time.now.utc,
969
959
  :expires => 90,
970
960
  :originator => "HttpClientTest",
@@ -981,7 +971,7 @@ describe Pandexio::HttpClient do
981
971
  (@document_cover_url.include? "X-Pdx-EmailAddress=HttpClientTest").must_equal true
982
972
  (@document_cover_url.include? "X-Pdx-DisplayName=HttpClientTest").must_equal true
983
973
  (@document_cover_url.include? "X-Pdx-Expires=90").must_equal true
984
- (@document_cover_url.include? "X-Pdx-Credential=#{TestConfig::DOMAIN_ID}").must_equal true
974
+ (@document_cover_url.include? "X-Pdx-Credential=#{DOMAIN_ID}").must_equal true
985
975
  (@document_cover_url.include? "X-Pdx-Signature=").must_equal true
986
976
  end
987
977
 
@@ -999,8 +989,8 @@ describe Pandexio::HttpClient do
999
989
  signing_options = Pandexio::SigningOptions.new(
1000
990
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
1001
991
  :mechanism => Pandexio::SigningMechanisms::QUERY_STRING,
1002
- :domain_id => TestConfig::DOMAIN_ID,
1003
- :domain_key => TestConfig::DOMAIN_KEY,
992
+ :domain_id => DOMAIN_ID,
993
+ :domain_key => DOMAIN_KEY,
1004
994
  :date => Time.now.utc,
1005
995
  :expires => 90,
1006
996
  :originator => "HttpClientTest",
@@ -1017,7 +1007,7 @@ describe Pandexio::HttpClient do
1017
1007
  (@document_cover_url.include? "X-Pdx-EmailAddress=HttpClientTest").must_equal true
1018
1008
  (@document_cover_url.include? "X-Pdx-DisplayName=HttpClientTest").must_equal true
1019
1009
  (@document_cover_url.include? "X-Pdx-Expires=90").must_equal true
1020
- (@document_cover_url.include? "X-Pdx-Credential=#{TestConfig::DOMAIN_ID}").must_equal true
1010
+ (@document_cover_url.include? "X-Pdx-Credential=#{DOMAIN_ID}").must_equal true
1021
1011
  (@document_cover_url.include? "X-Pdx-Signature=").must_equal true
1022
1012
  end
1023
1013
 
@@ -1035,8 +1025,8 @@ describe Pandexio::HttpClient do
1035
1025
  signing_options = Pandexio::SigningOptions.new(
1036
1026
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
1037
1027
  :mechanism => Pandexio::SigningMechanisms::QUERY_STRING,
1038
- :domain_id => TestConfig::DOMAIN_ID,
1039
- :domain_key => TestConfig::DOMAIN_KEY,
1028
+ :domain_id => DOMAIN_ID,
1029
+ :domain_key => DOMAIN_KEY,
1040
1030
  :date => Time.now.utc,
1041
1031
  :expires => 90,
1042
1032
  :originator => "HttpClientTest",
@@ -1053,7 +1043,7 @@ describe Pandexio::HttpClient do
1053
1043
  (@document_cover_url.include? "X-Pdx-EmailAddress=HttpClientTest").must_equal true
1054
1044
  (@document_cover_url.include? "X-Pdx-DisplayName=HttpClientTest").must_equal true
1055
1045
  (@document_cover_url.include? "X-Pdx-Expires=90").must_equal true
1056
- (@document_cover_url.include? "X-Pdx-Credential=#{TestConfig::DOMAIN_ID}").must_equal true
1046
+ (@document_cover_url.include? "X-Pdx-Credential=#{DOMAIN_ID}").must_equal true
1057
1047
  (@document_cover_url.include? "X-Pdx-Signature=").must_equal true
1058
1048
  end
1059
1049
 
@@ -1071,8 +1061,8 @@ describe Pandexio::HttpClient do
1071
1061
  signing_options = Pandexio::SigningOptions.new(
1072
1062
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
1073
1063
  :mechanism => Pandexio::SigningMechanisms::QUERY_STRING,
1074
- :domain_id => TestConfig::DOMAIN_ID,
1075
- :domain_key => TestConfig::DOMAIN_KEY,
1064
+ :domain_id => DOMAIN_ID,
1065
+ :domain_key => DOMAIN_KEY,
1076
1066
  :date => Time.now.utc,
1077
1067
  :expires => 90,
1078
1068
  :originator => "HttpClientTest",
@@ -1089,7 +1079,7 @@ describe Pandexio::HttpClient do
1089
1079
  (@document_cover_url.include? "X-Pdx-EmailAddress=HttpClientTest").must_equal true
1090
1080
  (@document_cover_url.include? "X-Pdx-DisplayName=HttpClientTest").must_equal true
1091
1081
  (@document_cover_url.include? "X-Pdx-Expires=90").must_equal true
1092
- (@document_cover_url.include? "X-Pdx-Credential=#{TestConfig::DOMAIN_ID}").must_equal true
1082
+ (@document_cover_url.include? "X-Pdx-Credential=#{DOMAIN_ID}").must_equal true
1093
1083
  (@document_cover_url.include? "X-Pdx-Signature=").must_equal true
1094
1084
  end
1095
1085
 
@@ -1177,13 +1167,13 @@ describe Pandexio::HttpClient do
1177
1167
  describe "when document does not exist" do
1178
1168
 
1179
1169
  before do
1180
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
1170
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
1181
1171
  id = UUID.new.generate
1182
1172
  signing_options = Pandexio::SigningOptions.new(
1183
1173
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
1184
1174
  :mechanism => Pandexio::SigningMechanisms::HEADER,
1185
- :domain_id => TestConfig::DOMAIN_ID,
1186
- :domain_key => TestConfig::DOMAIN_KEY,
1175
+ :domain_id => DOMAIN_ID,
1176
+ :domain_key => DOMAIN_KEY,
1187
1177
  :date => Time.now.utc,
1188
1178
  :expires => 90,
1189
1179
  :originator => "HttpClientTest",
@@ -1203,7 +1193,7 @@ describe Pandexio::HttpClient do
1203
1193
  describe "when document exists" do
1204
1194
 
1205
1195
  before do
1206
- skip("skip integration tests") if TestConfig::SKIP_INTEGRATION_TESTS
1196
+ skip("skip integration tests") if SKIP_INTEGRATION_TESTS
1207
1197
  @id = UUID.new.generate
1208
1198
  document_source = Pandexio::DocumentSource.new(
1209
1199
  :id => @id,
@@ -1213,8 +1203,8 @@ describe Pandexio::HttpClient do
1213
1203
  signing_options = Pandexio::SigningOptions.new(
1214
1204
  :algorithm => Pandexio::SigningAlgorithms::PDX_HMAC_SHA256,
1215
1205
  :mechanism => Pandexio::SigningMechanisms::HEADER,
1216
- :domain_id => TestConfig::DOMAIN_ID,
1217
- :domain_key => TestConfig::DOMAIN_KEY,
1206
+ :domain_id => DOMAIN_ID,
1207
+ :domain_key => DOMAIN_KEY,
1218
1208
  :date => Time.now.utc,
1219
1209
  :expires => 90,
1220
1210
  :originator => "HttpClientTest",
@@ -1222,7 +1212,6 @@ describe Pandexio::HttpClient do
1222
1212
  :display_name => "HttpClientTest")
1223
1213
  http_client = Pandexio::HttpClient.new()
1224
1214
  http_client.load_document(document_source, signing_options)
1225
- sleep(3)
1226
1215
  @get_document_snip_count = ->{ http_client.get_document_snip_count(@id, signing_options) }
1227
1216
  end
1228
1217
 
@@ -1234,5 +1223,4 @@ describe Pandexio::HttpClient do
1234
1223
  end
1235
1224
 
1236
1225
  end
1237
-
1238
1226
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandexio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
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: 2015-08-13 00:00:00.000000000 Z
12
+ date: 2015-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: 10.4.2
46
+ - !ruby/object:Gem::Dependency
47
+ name: minitest
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: 5.5.1
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 5.5.1
46
62
  - !ruby/object:Gem::Dependency
47
63
  name: uuid
48
64
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +66,7 @@ dependencies:
50
66
  requirements:
51
67
  - - ! '>='
52
68
  - !ruby/object:Gem::Version
53
- version: 2.3.8
69
+ version: 2.3.7
54
70
  type: :development
55
71
  prerelease: false
56
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +74,7 @@ dependencies:
58
74
  requirements:
59
75
  - - ! '>='
60
76
  - !ruby/object:Gem::Version
61
- version: 2.3.8
77
+ version: 2.3.7
62
78
  description: Pandexio SDK for Ruby
63
79
  email: bvarilone@gmail.com
64
80
  executables: []
@@ -67,6 +83,8 @@ extra_rdoc_files: []
67
83
  files:
68
84
  - README.md
69
85
  - Rakefile
86
+ - lib/ent/document.rb
87
+ - lib/ent/document_source.rb
70
88
  - lib/http_client.rb
71
89
  - lib/pandexio.rb
72
90
  - lib/request.rb