test_helper.rb 703 B

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