Sha256: d5e2016c4255c2939934609195d1994bea2b3b09aade352e8a9b7fd3ac9db14f

Contents?: true

Size: 1.07 KB

Versions: 36

Compression:

Stored size: 1.07 KB

Contents

shared_examples_for "an asset" do
  before(:all) do
    @preset = (@preset_params.nil? ? nil : Videojuicer::Preset.create(@preset_params.merge(:name => /\w{10}/.gen)))
    @user = Videojuicer::User.first
    raise "asset spec suite assumes at least one common user exists" if @user.nil?
  end
  
  after(:all) do
    @preset.destroy unless @preset.nil?
  end
  
  before(:each) do
    @original = @klass.gen unless @preset.nil?
  end
  
  after(:each) do
    @original.destroy unless @preset.nil?
    @derived.destroy unless @derived.nil?
  end
  
  it "external derivation should succeed" do
    unless @preset.nil?
      @derived = @klass.gen
      @derived.derived_internally.should == nil
      @derived.set_derived(@original, @preset)
      @derived.should be_valid
      @derived.derived_internally.should == false
    end
  end
  
  it "internal derivation should succeed" do
    unless @preset.nil?
      @derived = @original.derive(@preset)
      @derived.should be_valid
      @derived.id.should_not == @original.id
      @derived.derived_internally.should == true
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
vj-sdk-0.8.2 spec/shared/asset.rb
vj-sdk-0.8.0.1 spec/shared/asset_spec.rb
vj-sdk-0.7.14 spec/shared/asset_spec.rb
vj-sdk-0.7.13 spec/shared/asset_spec.rb
vj-sdk-0.7.11 spec/shared/asset_spec.rb
vj-sdk-0.7.10 spec/shared/asset_spec.rb
vj-sdk-0.7.9 spec/shared/asset_spec.rb
vj-sdk-0.7.8 spec/shared/asset_spec.rb
vj-sdk-0.7.7 spec/shared/asset_spec.rb
vj-sdk-0.7.6 spec/shared/asset_spec.rb
vj-sdk-0.7.5 spec/shared/asset_spec.rb
vj-sdk-0.7.4 spec/shared/asset_spec.rb
vj-sdk-0.7.3 spec/shared/asset_spec.rb
vj-sdk-0.7.2 spec/shared/asset_spec.rb
vj-sdk-0.7.1 spec/shared/asset_spec.rb
vj-sdk-0.7.0 spec/shared/asset_spec.rb
vj-sdk-0.6.9 spec/shared/asset_spec.rb
vj-sdk-0.6.8 spec/shared/asset_spec.rb
vj-sdk-0.6.7 spec/shared/asset_spec.rb
vj-sdk-0.6.5 spec/shared/asset_spec.rb