Ver Fonte

Added custom minimal shoulda method.

Dennis Theisen há 15 anos atrás
pai
commit
215e5e3b1d
2 ficheiros alterados com 8 adições e 4 exclusões
  1. 4 4
      test/shopify_api_test.rb
  2. 4 0
      test/test_helper.rb

+ 4 - 4
test/shopify_api_test.rb

@@ -3,19 +3,19 @@ require 'test_helper'
 class ShopifyApiTest < Test::Unit::TestCase
 class ShopifyApiTest < Test::Unit::TestCase
   
   
   context "Session" do
   context "Session" do
-    test "should raise error when blank shop url is provided" do
+    should "raise error when blank shop url is provided" do
       assert_raise(ArgumentError) { ShopifyAPI::Session.new("") }
       assert_raise(ArgumentError) { ShopifyAPI::Session.new("") }
     end
     end
 
 
-    test "should not be valid without token" do
+    should "not be valid without token" do
       session = ShopifyAPI::Session.new("testshop.myshopify.com")
       session = ShopifyAPI::Session.new("testshop.myshopify.com")
       assert_not session.valid?
       assert_not session.valid?
     end
     end
 
 
-    test "should be valid with any token" do
+    should "be valid with any token" do
       session = ShopifyAPI::Session.new("testshop.myshopify.com", "any-token")
       session = ShopifyAPI::Session.new("testshop.myshopify.com", "any-token")
       assert session.valid?
       assert session.valid?
     end
     end
-    
   end
   end
+  
 end
 end

+ 4 - 0
test/test_helper.rb

@@ -12,6 +12,10 @@ class Test::Unit::TestCase
   def self.test(string, &block)
   def self.test(string, &block)
     define_method("test:#{string}", &block)
     define_method("test:#{string}", &block)
   end
   end
+
+  def self.should(string, &block)
+    self.test("should_#{string}", &block)
+  end
   
   
   def self.context(string)
   def self.context(string)
     yield
     yield