test_helper.rb 604 B

123456789101112131415161718192021222324
  1. require 'rubygems'
  2. require 'test/unit'
  3. $LOAD_PATH.unshift(File.dirname(__FILE__))
  4. $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
  5. require 'shopify_api'
  6. # setup ShopifyAPI with fake api_key and secret
  7. ShopifyAPI::Session.setup(:api_key => "API Test key", :secret => "API Test secret")
  8. class Test::Unit::TestCase
  9. def self.test(string, &block)
  10. define_method("test:#{string}", &block)
  11. end
  12. def self.context(string)
  13. yield
  14. end
  15. # Custom Assertions
  16. def assert_not(expression)
  17. assert_block("Expected <#{expression}> to be false!") { not expression }
  18. end
  19. end