test_helper.rb 687 B

12345678910111213141516171819202122232425262728
  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.should(string, &block)
  13. self.test("should_#{string}", &block)
  14. end
  15. def self.context(string)
  16. yield
  17. end
  18. # Custom Assertions
  19. def assert_not(expression)
  20. assert_block("Expected <#{expression}> to be false!") { not expression }
  21. end
  22. end