trackerific 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +8 -0
  3. data/.rspec +1 -2
  4. data/Gemfile +3 -22
  5. data/Gemfile.lock +33 -107
  6. data/README.rdoc +35 -61
  7. data/Rakefile +10 -36
  8. data/lib/trackerific/configuration.rb +3 -46
  9. data/lib/trackerific/details.rb +2 -71
  10. data/lib/trackerific/event.rb +5 -49
  11. data/lib/trackerific/services/base.rb +45 -0
  12. data/lib/trackerific/services/fedex.rb +75 -85
  13. data/lib/trackerific/services/mock_service.rb +43 -54
  14. data/lib/trackerific/services/ups.rb +94 -103
  15. data/lib/trackerific/services/usps.rb +182 -186
  16. data/lib/trackerific/services.rb +41 -0
  17. data/lib/trackerific/version.rb +3 -0
  18. data/lib/trackerific.rb +30 -73
  19. data/spec/fixtures/{fedex_error_response.xml → fedex/error.xml} +0 -0
  20. data/spec/fixtures/{fedex_success_response.xml → fedex/success.xml} +0 -0
  21. data/spec/fixtures/{ups_error_response.xml → ups/error.xml} +0 -0
  22. data/spec/fixtures/{ups_success_response.xml → ups/success.xml} +0 -0
  23. data/spec/fixtures/{usps_city_state_lookup_response.xml → usps/city_state_lookup.xml} +0 -0
  24. data/spec/fixtures/{usps_error_response.xml → usps/error.xml} +0 -0
  25. data/spec/fixtures/{usps_success_response.xml → usps/success.xml} +0 -0
  26. data/spec/lib/trackerific/configuration_spec.rb +8 -39
  27. data/spec/lib/trackerific/details_spec.rb +13 -78
  28. data/spec/lib/trackerific/error_spec.rb +1 -5
  29. data/spec/lib/trackerific/event_spec.rb +14 -43
  30. data/spec/lib/trackerific/services/base_spec.rb +13 -0
  31. data/spec/lib/trackerific/services/fedex_spec.rb +59 -62
  32. data/spec/lib/trackerific/services/mock_service_spec.rb +33 -46
  33. data/spec/lib/trackerific/services/ups_spec.rb +46 -66
  34. data/spec/lib/trackerific/services/usps_spec.rb +80 -94
  35. data/spec/lib/trackerific/services_spec.rb +37 -0
  36. data/spec/lib/trackerific/version_spec.rb +5 -0
  37. data/spec/lib/trackerific_spec.rb +15 -53
  38. data/spec/spec_helper.rb +2 -9
  39. data/spec/support/fixtures.rb +4 -18
  40. data/spec/support/test_services.rb +23 -0
  41. data/trackerific.gemspec +24 -102
  42. metadata +151 -185
  43. data/VERSION +0 -1
  44. data/changelog +0 -9
  45. data/examples/custom_service_spec.rb +0 -44
  46. data/lib/helpers/options_helper.rb +0 -23
  47. data/lib/trackerific/service.rb +0 -100
  48. data/spec/lib/helpers/options_helper_spec.rb +0 -82
  49. data/spec/lib/trackerific/service_spec.rb +0 -44
  50. data/spec/support/trackerific.rb +0 -21
@@ -1,44 +0,0 @@
1
- require 'spec_helper'
2
-
3
- class TestServiceClass < Trackerific::Service
4
- class << self
5
- def required_parameters
6
- [:required, :also_required]
7
- end
8
- end
9
- end
10
-
11
- describe Trackerific::Service do
12
-
13
- describe :required_parameters do
14
- specify { Trackerific::Service.required_parameters.should be_kind_of Array }
15
- end
16
-
17
- describe :service_name do
18
- specify { Trackerific::Service.service_name.should be_kind_of String }
19
- end
20
-
21
- context "with a new Trackerific::Service class that has required options" do
22
-
23
- context "has all the required options" do
24
- it "should be able to create a new instance" do
25
- t = TestServiceClass.new(:required => true, :also_required => :yup)
26
- t.should be_a TestServiceClass
27
- end
28
- end
29
-
30
- context "is missing some required options" do
31
- it "should raise an ArgumentError" do
32
- lambda { TestServiceClass.new() }.should raise_error(ArgumentError)
33
- end
34
- end
35
-
36
- context "has an invalid option" do
37
- it "should raise an ArgumentError" do
38
- lambda { TestServiceClass.new(:unknown => :argument ) }.should raise_error(ArgumentError)
39
- end
40
- end
41
-
42
- end
43
-
44
- end
@@ -1,21 +0,0 @@
1
- require 'rails'
2
-
3
- require "action_controller/railtie"
4
- require "action_mailer/railtie"
5
- require "active_resource/railtie"
6
-
7
- module Trackerific
8
- # Provides a Rails application environment to use when running the specs
9
- class Application < Rails::Application
10
- config.encoding = 'utf-8'
11
- end
12
-
13
- Application.configure do
14
- config.active_support.deprecation = :stderr
15
- config.logger = Logger.new(STDOUT)
16
- end
17
- end
18
-
19
- puts "Loading Rails environment ..."
20
- Rails.env = 'test'
21
- Trackerific::Application.initialize!