Skip to content

Commit

Permalink
XAP Spec (Chiron only, as RubyZip is rediculously slow)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschementi committed Jun 22, 2008
1 parent 1687fc1 commit 50135ad
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions vendor/plugins/silverline/spec/silverline/essential/xap_spec.rb
@@ -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

0 comments on commit 50135ad

Please sign in to comment.