test/test_statsmix.rb in statsmix-0.1.10 vs test/test_statsmix.rb in statsmix-0.2.1
- old
+ new
@@ -10,13 +10,24 @@
# TODO use VCR for tests
# http://www.rubyinside.com/vcr-a-recorder-for-all-your-tests-http-interactions-4169.html
# https://github.com/myronmarston/vcr
- should "Track a stat and view the results in xml" do
+ should "Track a stat and view the result in xml" do
StatsMix.api_key = '59f08613db2691f28afe'
+ StatsMix.format = 'xml'
result = StatsMix.track('Ruby Gem Testing')
- assert_response 200
+ if StatsMix.error
+ raise "Error in gem: #{StatsMix.error}"
+ end
+ assert !StatsMix.error
+ puts result
+ end
+
+ should "Track a stat and view the result in json" do
+ StatsMix.api_key = '59f08613db2691f28afe'
+ StatsMix.format = 'json'
+ result = StatsMix.track('Ruby Gem Testing')
if StatsMix.error
raise "Error in gem: #{StatsMix.error}"
end
assert !StatsMix.error
puts result
\ No newline at end of file