Bundler.setup(:default, :test) require 'cucumber' require 'rspec' require 'mocha' # Use mocha for mocking RSpec.configure do |config| config.mock_with :mocha end # Verify mocha after each scenario After do Mocha::Mockery.instance.verify(nil) Mocha::Mockery.instance.teardown Mocha::Mockery.reset_instance end require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'animoto', 'client')) module Animoto class IntegrationTest include Mocha::API def client @client ||= begin endpoint = case ENV['ANIMOTO_PLATFORM_ENV'] when 'production' : '' when NilClass : '-sandbox' else : "-#{ENV['ANIMOTO_PLATFORM_ENV']}" end Client.new ENV['ANIMOTO_USERNAME'], ENV['ANIMOTO_PASSWORD'], :endpoint => endpoint end end end end World { Animoto::IntegrationTest.new }