File: win32.rb

package info (click to toggle)
ruby-bluefeather 0.41-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 676 kB
  • ctags: 169
  • sloc: ruby: 4,195; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 963 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'pathname'
require(Pathname.new(__FILE__).parent + 'lib/common.rb')

if RUBY_PLATFORM =~ /win|mingw/ then

	describe 'DOS Pathname:' do
	
		before do
			@prefix = File.expand_path(File.dirname(__FILE__))
			@unix_path = "#{@prefix}/text/encoding_sample_default.bfdoc"
			@dos_path = "#{@prefix.gsub('/', '\\')}\\text\\encoding_sample_default.bfdoc"
			@cmd_path = Pathname.new(__FILE__).parent.parent + 'bin/bluefeather'
			@lib_dir = Pathname.new(__FILE__).parent.parent + 'lib'
		end
		
		specify 'command run' do
			File.exist?(@unix_path).should be_true
			File.exist?(@dos_path).should be_true
			
			system("ruby -I #{@lib_dir} #{@cmd_path} --quiet #{@unix_path}").should be_true
			system("ruby -I #{@lib_dir} #{@cmd_path} --quiet #{@dos_path}").should be_true
		end
		
		after do
			dest = @unix_path.sub(/.bfdoc$/, '.html')
			File.unlink(dest) if File.exist?(dest)
		end
	end
else
	puts "spec/win32.rb skipped."
end