Sha256: 0c908b6841d2a31a154b0cedea08da906f0acac66d086336bfa70b9e29683a26

Contents?: true

Size: 1.91 KB

Versions: 5

Compression:

Stored size: 1.91 KB

Contents

require 'rubygems'
require 'spec'
require 'yaml'

unless defined?(Mash)
  # Don't require Mash twice. It causes cranial trauma.
  require 'mash'
end

begin
  require 'randexp'
rescue LoadError
  raise "The Randexp gem is required in order to run the test suites, but it is not required to use the SDK in production environments. To run the tests, please `sudo gem install randexp`"
end

require File.join(File.dirname(__FILE__), "..", "..", "lib", "videojuicer")
require File.join(File.dirname(__FILE__), "..", "shared", "configurable_spec")
require File.join(File.dirname(__FILE__), "..", "shared", "model_spec")
require File.join(File.dirname(__FILE__), "..", "shared", "resource_spec")
require File.join(File.dirname(__FILE__), "..", "shared", "embeddable_spec")
require File.join(File.dirname(__FILE__), "..", "shared", "dependent_spec")
require File.join(File.dirname(__FILE__), "..", "shared", "asset_spec")

# Load the fixture helper
require File.join(File.dirname(__FILE__), "spec_fixtures")

module SpecHelper
  
  def configure_test_settings(overrides={})
    Videojuicer.configure!({
      :api_version      => 1,
      :protocol         => "http",
      :host             => "localhost",
      :port             => 6666,
      :consumer_key     => fixtures["write-master"]["consumer"]["consumer_key"],
      :consumer_secret  => fixtures["write-master"]["consumer"]["consumer_secret"],
      :token            => fixtures["write-master"]["authorized_token"]["oauth_token"],
      :token_secret     => fixtures["write-master"]["authorized_token"]["oauth_token_secret"],
      :seed_name        => fixtures["seed"]["name"]
    }.merge(overrides))
  end
  
  def fixtures
    fixture_path = File.join(File.dirname(__FILE__), "..", "..", "core-fixtures.yml")
    fixture_src = File.open(fixture_path).read
    @core_fixtures ||= Mash.new(YAML.load(fixture_src))
  end
  
end

Spec::Runner.configure do |config|
    config.include(SpecHelper)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vj-sdk-0.4.3 spec/helpers/spec_helper.rb
vj-sdk-0.4.2 spec/helpers/spec_helper.rb
vj-sdk-0.4.1 spec/helpers/spec_helper.rb
vj-sdk-0.4.0 spec/helpers/spec_helper.rb
vj-sdk-0.2.1 spec/helpers/spec_helper.rb