Update changelog for 0.20.
[tails-test.git] / features / support / env.rb
blobf5b7b243a0264c0f98d819bc650145ce9dc5426d
1 require 'java'
2 require 'rubygems'
3 require "#{Dir.pwd}/features/support/extra_hooks.rb"
4 require 'time'
5 require 'rspec'
7 def fatal_system(str)
8   unless system(str)
9     raise StandardError.new("Command exited with #{$?}")
10   end
11 end
13 def git_exists?
14   File.exists? '.git'
15 end
17 def create_git
18   Dir.mkdir 'debian'
19   File.open('debian/changelog', 'w') do |changelog|
20     changelog.write(<<END_OF_CHANGELOG)
21 tails (0) stable; urgency=low
23   * First release.
25  -- Tails developers <tails@boum.org>  Mon, 30 Jan 2012 01:00:00 +0000
26 END_OF_CHANGELOG
27   end
29   fatal_system "git init --quiet"
30   fatal_system "git config user.email 'tails@boum.org'"
31   fatal_system "git config user.name 'Tails developers'"
32   fatal_system "git add debian/changelog"
33   fatal_system "git commit --quiet debian/changelog -m 'First release'"
34   fatal_system "git branch -M stable"
35   fatal_system "git branch testing stable"
36   fatal_system "git branch devel stable"
37   fatal_system "git branch experimental devel"
38 end
40 RSpec::Matchers.define :have_suite do |suite|
41   match do |string|
42     # e.g.: `deb http://deb.tails.boum.org/ 0.10 main contrib non-free`
43     %r{^deb +http://deb\.tails\.boum\.org/ +#{Regexp.escape(suite)} main}.match(string)
44   end
45   failure_message_for_should do |string|
46     "expected the sources to include #{suite}\nCurrent sources : #{string}"
47   end
48   failure_message_for_should_not do |string|
49     "expected the sources to exclude #{suite}\nCurrent sources : #{string}"
50   end
51   description do
52     "expected an output with #{suite}"
53   end
54 end