Created
May 17, 2013 09:52
-
-
Save valachi/5598111 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context "when prefered has to pay it's cap" do | |
let!(:shareholder1){ company.share_holders.create!(name: 'Darth Vader') } | |
let!(:ownerships){ [series_a_stock.ownerships.create(amount: 1e5), common_stock.ownerships.create(amount: 2e5),option_grant ] } | |
let(:returns) do | |
[ | |
[{ round: Logarithm::RoundProxy.new(series_a_stock), money: 1e5, money_per_share: 1 } ], #preference | |
[{ round: Logarithm::RoundProxy.new(common_stock), money: 1e5, money_per_share: 0.5 }], #excercise option | |
[ #cap | |
{ round: Logarithm::RoundProxy.new(common_stock), money: 1e5, money_per_share: 0.5 }, | |
{ round: Logarithm::RoundProxy.new(option_grant), money: 5e4, money_per_share: 0.5 } | |
], | |
] | |
end | |
it { distribution.infinity_delta.should == 3.5e5*(10-1) } #target exit 350k, infinity is 10 - 1 by definition. | |
it { distribution.securities.should =~[series_a_stock,common_stock,option_grant] } | |
it { distribution.amount_of_shares.should == (series_a_stock.amount + common_stock.amount + option_grant.amount) } | |
it { distribution.infinity.should == 3.5e6 } | |
it { distribution.per_share_of(series_a_stock).should == [1,0,0,7.875] } | |
it { distribution.of(series_a_stock).should == [ 1e5,0,0,7.875e5 ] } | |
it { distribution.per_share_of(common_stock).should == [ 0,0.5,0.5,7.875] } | |
it { distribution.of(common_stock).should == [0, 1e5, 1e5, 15.75e5] } | |
it { distribution.per_share_of(option_grant).should == [ 0,0,0.5,7.875] } | |
it { distribution.of(option_grant).should == [ 0,0,5e4,7.875e5] } | |
it { distribution.slices.should == [1e5, 1e5, 1.5e5, 3.15e6] } | |
it { distribution.cumultative_slices.should == [1e5,2e5,3.5e5,3.5e6] } | |
#it { distribution.slices_by_target_exit(series_a_stock,1333).should == [series_a_stock.amount*1.5,0,0] } #take part of the round | |
#it { distribution.slices_by_target_exit(series_a_stock,133).should == [133,0,0] } #take part of the round | |
#it { distribution.slices_by_target_exit(series_a_stock,3333).should == 1000 } #take part of the round | |
#it { distribution.slices_by_target_exit(series_a_stock,100000).should == 33333 } #take part of the round | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment