Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XAP Spec (Chiron only, as RubyZip is rediculously slow)
- Loading branch information
1 parent
1687fc1
commit 50135ad
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
vendor/plugins/silverline/spec/silverline/essential/xap_spec.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
require File.dirname(__FILE__) + '/../../spec_nonrails.rb' | ||
|
||
def prepare_xap(platform = nil) | ||
Silverline::Essential.instance_eval{remove_const :Xap} if defined?(Silverline::Essential::Xap) | ||
yield | ||
load 'silverline/essential/xap.rb' | ||
@xap = Silverline::Essential::XAP.new("foo", "Bar") | ||
@chr = "public/ironruby/Chiron.exe /s /d:Bar /z:foo" unless platform.nil? | ||
end | ||
|
||
describe "XAPBase" do | ||
|
||
it "should initialize itself with a file to XAP to and a directory to XAP" do | ||
xapbase = Silverline::Essential::XAPBase.new("foo", "Bar") | ||
xapbase.instance_variable_get(:@file) == "foo" | ||
xapbase.instance_variable_get(:@files) == [] | ||
xapbase.instance_variable_get(:@directory) == "Bar" | ||
end | ||
|
||
end | ||
|
||
describe "Chiron XAP on Windows" do | ||
|
||
it "should generate the XAP" do | ||
prepare_xap(:windows) { Silverline::Essential::Xap = :chiron } | ||
@xap.should_receive(:system).with("mono #{@chr}").and_return false | ||
@xap.should_receive(:system).with(@chr).and_return true | ||
|
||
@xap.generate | ||
end | ||
|
||
end | ||
|
||
describe "Chiron XAP on Mono" do | ||
|
||
it "should generate the XAP" do | ||
prepare_xap(:mono) { Silverline::Essential::Xap = :chiron } | ||
|
||
@xap.should_receive(:system).with("mono #{@chr}").and_return true | ||
@xap.should_not_receive(:system).with(@chr) | ||
|
||
@xap.generate | ||
end | ||
|
||
end | ||
|
||
=begin | ||
describe "Ruby XAP" do | ||
it "should generate the XAP" do | ||
#prepare_xap { Silverline::Essential::Xap = :rubyzip } | ||
pending | ||
end | ||
it "should generate the AppManifest" do | ||
pending | ||
end | ||
end | ||
=end |