rspec-system 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.gitignore +1 -0
  2. data/.ruby-version +1 -1
  3. data/Gemfile +1 -1
  4. data/README.md +45 -0
  5. data/examples/.gitignore +1 -0
  6. data/examples/.nodeset.yml +7 -0
  7. data/examples/.ruby-version +1 -0
  8. data/examples/Gemfile +6 -0
  9. data/examples/Rakefile +6 -0
  10. data/examples/spec/spec_helper.rb +1 -0
  11. data/examples/spec/system/{tests/test1.rb → test1_spec.rb} +2 -4
  12. data/examples/spec/system/test2_spec.rb +9 -0
  13. data/examples/spec/system/test3_spec.rb +13 -0
  14. data/lib/rspec-system.rb +4 -2
  15. data/lib/rspec-system/formatter.rb +47 -0
  16. data/lib/rspec-system/helpers.rb +4 -1
  17. data/lib/rspec-system/log.rb +13 -0
  18. data/lib/rspec-system/node_set.rb +7 -25
  19. data/lib/rspec-system/node_set/base.rb +36 -0
  20. data/lib/rspec-system/node_set/vagrant.rb +39 -38
  21. data/lib/rspec-system/rake_task.rb +17 -0
  22. data/lib/rspec-system/spec_helper.rb +42 -0
  23. data/resources/kwalify-schemas/nodeset_schema.yml +17 -0
  24. data/rspec-system.gemspec +4 -4
  25. data/spec/fixtures/nodeset_example1.yml +7 -0
  26. data/spec/fixtures/nodeset_example2.yml +9 -0
  27. data/spec/spec_helper.rb +25 -0
  28. data/spec/unit/kwalify-schemas/nodeset_schema_spec.rb +28 -0
  29. metadata +31 -19
  30. data/examples/spec/.gitignore +0 -1
  31. data/examples/spec/system/distros/centos-58-x64_spec.rb +0 -14
  32. data/examples/spec/system/distros/debian-606-x64_spec.rb +0 -14
  33. data/examples/spec/system/tests/test2.rb +0 -11
  34. data/examples/spec/system_spec_helper.rb +0 -7
  35. data/examples/spec/systemtmp/rspec_system_vagrant/centos-58-x64/.vagrant +0 -1
  36. data/examples/spec/systemtmp/rspec_system_vagrant/centos-58-x64/Vagrantfile +0 -6
  37. data/lib/rspec-system/shared_contexts.rb +0 -44
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  Gemfile.lock
2
+ *.gem
2
3
  .*.swp
@@ -1 +1 @@
1
- ruby-1.9.3-p362@rspec-system-vagrant
1
+ ruby-1.9.3@rspec-system
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
@@ -0,0 +1,45 @@
1
+ # rspec-system
2
+
3
+ System testing with rspec.
4
+
5
+ * [Usage](#usage)
6
+ * [Setup](#setup)
7
+ * [Tests](#tests)
8
+
9
+ ## Usage
10
+
11
+ ### Setup
12
+
13
+ #### Gem installation
14
+
15
+ The intention is that this gem is used within your project as a development library.
16
+
17
+ Either install `rspec-system` manually with:
18
+
19
+ gem install rspec-system
20
+
21
+ However it is usually recommended to include it in your `Gemfile` and let bundler install it, by adding the following:
22
+
23
+ gem 'rspec-system'
24
+
25
+ Then installing with:
26
+
27
+ bundle install
28
+
29
+ #### Configuration
30
+
31
+ TODO: for now just look at the `examples` directory.
32
+
33
+ ### Tests
34
+
35
+ Start by looking at the `examples` directory. I plan on fleshing out this documentation but for now just use the example.
36
+
37
+ #### Running tests
38
+
39
+ Run the system tests with:
40
+
41
+ rake spec:system
42
+
43
+ #### Writing tests
44
+
45
+ Create the directory `spec/system` in your project. Add files with the spec prefix ie. `mytests_spec.rb`.
@@ -0,0 +1 @@
1
+ spec/system/tmp
@@ -0,0 +1,7 @@
1
+ ---
2
+ default_set: 'centos-58-x64'
3
+ sets:
4
+ 'centos-58-x64':
5
+ nodes:
6
+ "main":
7
+ prefab: 'centos-58-x64'
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p392@rspec-system-example
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ ruby "1.9.3"
4
+
5
+ gem 'rspec-system', :path => '../'
6
+ gem 'rake', :require => false
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ Bundler.require :default, :test
5
+
6
+ require 'rspec-system/rake_task'
@@ -0,0 +1 @@
1
+ require 'rspec-system/spec_helper'
@@ -1,13 +1,11 @@
1
- require 'system_spec_helper'
1
+ require 'spec_helper'
2
2
 
3
- shared_examples "test1", :scope => :all do
3
+ describe "test1" do
4
4
  it 'run test1 - part1' do
5
- puts 'test1 - part1'
6
5
  run_on('main', "cat /etc/resolv.conf")
7
6
  end
8
7
 
9
8
  it 'run test1 - part2' do
10
- puts 'test1 - part2'
11
9
  run_on('main', "cat /etc/issue")
12
10
  end
13
11
  end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe "test2" do
4
+ it 'run test2 - part1' do
5
+ end
6
+
7
+ it 'run test2 - part2' do
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe "test3 - some failures" do
4
+ it 'should fail with exception' do
5
+ raise 'my exception'
6
+ end
7
+
8
+ pending 'test out pending messages'
9
+
10
+ it 'should fail with matcher failure' do
11
+ true.should be_false
12
+ end
13
+ end
@@ -2,13 +2,15 @@ require 'rspec'
2
2
 
3
3
  module RSpecSystem; end
4
4
 
5
+ require 'rspec-system/log'
5
6
  require 'rspec-system/helpers'
6
7
  require 'rspec-system/node_set'
7
- require 'rspec-system/shared_contexts'
8
8
 
9
9
  RSpec::configure do |c|
10
10
  c.include RSpecSystem::Helpers
11
11
 
12
12
  # This provides a path to save vagrant files
13
- c.add_setting :rspec_system_vagrant_projects
13
+ c.add_setting :system_tmp
14
+ # Node set configuration
15
+ c.add_setting :system_nodesets
14
16
  end
@@ -0,0 +1,47 @@
1
+ require "rspec/core/formatters/base_text_formatter"
2
+
3
+ module RSpecSystem
4
+ class Formatter < RSpec::Core::Formatters::BaseTextFormatter
5
+ def initialize(output)
6
+ super(output)
7
+ end
8
+
9
+ def start(count)
10
+ super(count)
11
+ output << "=================================================================\n\n"
12
+ output << bold("Commencing rspec-system tests\n")
13
+ output << bold("Total Test Count: ") << color(count, :cyan) << "\n\n"
14
+ end
15
+
16
+ def example_started(example)
17
+ super(example)
18
+ output << "=================================================================\n\n"
19
+ output << bold("Running test:\n ") << color(example.full_description, :magenta) << "\n\n"
20
+ end
21
+
22
+ def example_passed(example)
23
+ super(example)
24
+ output << "\n" << bold('Result: ') << success_color('passed') << "\n\n"
25
+ end
26
+
27
+ def example_pending(example)
28
+ super(example)
29
+ msg = example.execution_result[:pending_message]
30
+ output << "\n" << bold('Result: ') << pending_color('pending') << "\n"
31
+ output << bold("Reason: ") << "#{msg}\n\n"
32
+ end
33
+
34
+ def example_failed(example)
35
+ super(example)
36
+ msg = example.execution_result[:exception]
37
+ output << "\n" << bold('Result: ') << failure_color('failed') << "\n"
38
+ output << bold("Index: ") << "#{next_failure_index}\n"
39
+ output << bold("Reason:\n") << "#{msg}\n\n"
40
+ end
41
+
42
+ def next_failure_index
43
+ @next_failure_index ||= 0
44
+ @next_failure_index += 1
45
+ end
46
+ end
47
+ end
@@ -1,5 +1,8 @@
1
1
  module RSpecSystem::Helpers
2
2
  def run_on(dest, command)
3
- rspec_system_node_set.run(dest,command)
3
+ log.info("run_on(#{dest}, #{command}) executed")
4
+ result = rspec_system_node_set.run(dest, command)
5
+ log.info("run_on(#{dest}, #{command}) finished\n--result--\n#{result}\n--result--\n")
6
+ result
4
7
  end
5
8
  end
@@ -0,0 +1,13 @@
1
+ require 'logger'
2
+
3
+ module RSpecSystem::Log
4
+ def log
5
+ return @logger if @logger
6
+ @logger = ::Logger.new(STDOUT)
7
+ @logger.progname = 'rspec-system'
8
+ @logger.formatter = Proc.new do |s, t, p, m|
9
+ "#{s}: #{m}\n"
10
+ end
11
+ @logger
12
+ end
13
+ end
@@ -1,35 +1,17 @@
1
1
  module RSpecSystem
2
+ # Factory class for NodeSet.
2
3
  class NodeSet
3
- attr_reader :config, :virtual_env
4
-
5
- def initialize(config, virtual_env)
6
- @config = config
7
- @virtual_env = virtual_env
8
-
9
- @virtual_driver = case(@virtual_env)
4
+ # Returns a NodeSet object.
5
+ def self.create(setname, config, virtual_env)
6
+ case(virtual_env)
10
7
  when 'vagrant'
11
- RSpecSystem::NodeSet::Vagrant.new(@config)
8
+ RSpecSystem::NodeSet::Vagrant.new(setname, config)
12
9
  else
13
- raise "Unsupported virtual environment #{@virtual_env}"
10
+ raise "Unsupported virtual environment #{virtual_env}"
14
11
  end
15
12
  end
16
-
17
- def setup
18
- @virtual_driver.setup
19
- end
20
-
21
- def teardown
22
- @virtual_driver.teardown
23
- end
24
-
25
- def rollback
26
- @virtual_driver.rollback
27
- end
28
-
29
- def run(dest, command)
30
- @virtual_driver.run(dest,command)
31
- end
32
13
  end
33
14
  end
34
15
 
16
+ require 'rspec-system/node_set/base'
35
17
  require 'rspec-system/node_set/vagrant'
@@ -0,0 +1,36 @@
1
+ module RSpecSystem
2
+ # Base class for a NodeSet.
3
+ class NodeSet::Base
4
+ attr_reader :config, :setname
5
+
6
+ def initialize(setname, config)
7
+ @setname = setname
8
+ @config = config
9
+ end
10
+
11
+ # Setup the NodeSet by starting all nodes.
12
+ def setup
13
+ end
14
+
15
+ # Shutdown the NodeSet by shutting down or pausing all nodes.
16
+ def teardown
17
+ end
18
+
19
+ # Take a snapshot of the NodeSet for rollback later.
20
+ def snapshot
21
+ end
22
+
23
+ # Rollback to the snapshot of the NodeSet.
24
+ def rollback
25
+ end
26
+
27
+ # Run a command on a host in the NodeSet.
28
+ def run(dest, command)
29
+ end
30
+
31
+ # Return environment type
32
+ def env_type
33
+ self.class::ENV_TYPE
34
+ end
35
+ end
36
+ end
@@ -1,74 +1,67 @@
1
- require 'vagrant'
2
1
  require 'fileutils'
3
2
 
4
3
  module RSpecSystem
5
- class NodeSet::Vagrant
6
- def initialize(config)
7
- @config = config
8
- @vagrant_path = File.expand_path(File.join(RSpec.configuration.rspec_system_vagrant_projects, @config[:id].to_s))
4
+ # A NodeSet implementation for Vagrant.
5
+ class NodeSet::Vagrant < RSpecSystem::NodeSet::Base
6
+ include RSpecSystem::Log
7
+
8
+ ENV_TYPE = 'vagrant'
9
+
10
+ def initialize(setname, config)
11
+ super
12
+ @vagrant_path = File.expand_path(File.join(RSpec.configuration.system_tmp, 'vagrant_projects', setname))
9
13
  end
10
14
 
15
+ # Setup the NodeSet by starting all nodes.
11
16
  def setup
12
- puts "Setting up vagrant!"
13
- create_virtualboxfile
17
+ log.info "Begin setting up vagrant"
18
+ create_vagrantfile
14
19
 
15
- puts "prepping vagrant environment"
16
- @vagrant_env = Vagrant::Environment.new(:cwd => @vagrant_path)
17
- puts "running vagrant up"
18
- @vagrant_env.cli("up")
20
+ log.info "Running 'vagrant destroy'"
21
+ vagrant("destroy", "--force")
19
22
 
20
- snapshot
23
+ log.info "Running 'vagrant up'"
24
+ vagrant("up")
21
25
  end
22
26
 
27
+ # Shutdown the NodeSet by shutting down or pausing all nodes.
23
28
  def teardown
24
- puts "running vagrant down"
25
- @vagrant_env.cli("suspend")
26
- end
27
-
28
- def snapshot
29
- puts "turning on sandbox"
30
- Dir.chdir(@vagrant_path) do
31
- @vagrant_env.cli("sandbox", "on")
32
- end
33
- end
34
-
35
- def rollback
36
- puts "rolling back vagrant box"
37
- Dir.chdir(@vagrant_path) do
38
- @vagrant_env.cli("sandbox", "rollback")
39
- end
29
+ log.info "Running 'vagrant destroy'"
30
+ vagrant("destroy", "--force")
40
31
  end
41
32
 
33
+ # Run a command on a host in the NodeSet.
42
34
  def run(dest, command)
43
- puts "Running #{command} on #{dest}"
44
35
  result = ""
45
- @vagrant_env.vms[dest.to_sym].channel.sudo("cd /tmp && #{command}") do |ch, data|
46
- result << data
47
- puts "Got data: #{data}"
36
+ Dir.chdir(@vagrant_path) do
37
+ result = `vagrant ssh #{dest} --command 'cd /tmp && #{command}'`
48
38
  end
49
39
  result
50
40
  end
51
41
 
42
+ # Create the Vagrantfile for the NodeSet.
52
43
  # @api private
53
- def create_virtualboxfile
54
- puts "Creating vagrant file here: #{@vagrant_path}"
44
+ def create_vagrantfile
45
+ log.info "Creating vagrant file here: #{@vagrant_path}"
55
46
  FileUtils.mkdir_p(@vagrant_path)
56
47
  File.open(File.expand_path(File.join(@vagrant_path, "Vagrantfile")), 'w') do |f|
57
48
  f.write('Vagrant::Config.run do |c|')
58
- @config[:nodes].each do |k,v|
59
- puts "prepping #{k}"
49
+ @config['nodes'].each do |k,v|
50
+ log.debug "Filling in content for #{k}"
60
51
  f.write(<<-EOS)
61
52
  c.vm.define '#{k}' do |vmconf|
62
- #{setup_prefabs(v[:prefab])}
53
+ #{template_prefabs(v["prefab"])}
63
54
  end
64
55
  EOS
65
56
  end
66
57
  f.write('end')
67
58
  end
59
+ log.debug "Finished creating vagrant file"
68
60
  end
69
61
 
62
+ # Provide Vagrantfile templates for prefabs.
70
63
  # @api private
71
- def setup_prefabs(prefab)
64
+ def template_prefabs(prefab)
72
65
  case prefab
73
66
  when 'centos-58-x64'
74
67
  <<-EOS
@@ -84,5 +77,13 @@ module RSpecSystem
84
77
  raise 'Unknown prefab'
85
78
  end
86
79
  end
80
+
81
+ # Execute vagrant command in vagrant_path
82
+ # @api private
83
+ def vagrant(*args)
84
+ Dir.chdir(@vagrant_path) do
85
+ system("vagrant", *args)
86
+ end
87
+ end
87
88
  end
88
89
  end
@@ -0,0 +1,17 @@
1
+ require 'rubygems'
2
+ require "bundler/setup"
3
+
4
+ Bundler.require :default, :test
5
+
6
+ require 'rspec/core/rake_task'
7
+ require 'rspec-system/formatter'
8
+
9
+ RSpec::Core::RakeTask.new(:spec_system) do |c|
10
+ c.pattern = "spec/system/**/test1_spec.rb"
11
+ c.rspec_opts = %w[--require rspec-system/formatter --format=RSpecSystem::Formatter]
12
+ end
13
+
14
+ namespace :spec do
15
+ desc 'Run system tests'
16
+ task :system => :spec_system
17
+ end
@@ -0,0 +1,42 @@
1
+ require 'rspec-system'
2
+ require 'yaml'
3
+ require 'pp'
4
+ require 'tempfile'
5
+
6
+ RSpec.configure do |c|
7
+ include RSpecSystem::Log
8
+
9
+ def nodeset
10
+ Pathname.new(File.join(File.basename(__FILE__), '..', '.nodeset.yml'))
11
+ end
12
+
13
+ def rspec_system_config
14
+ YAML.load_file('.nodeset.yml')
15
+ end
16
+
17
+ # Grab the type of virtual environment we wish to run these tests in
18
+ def rspec_virtual_env
19
+ ENV["RSPEC_VIRTUAL_ENV"] || 'vagrant'
20
+ end
21
+
22
+ def rspec_system_node_set
23
+ setname = ENV['RSPEC_SET'] || rspec_system_config['default_set']
24
+ config = rspec_system_config['sets'][setname]
25
+ RSpecSystem::NodeSet.create(setname, config, rspec_virtual_env)
26
+ end
27
+
28
+ c.system_tmp = Dir.tmpdir
29
+ c.before :suite do
30
+ log.info "START RSPEC-SYSTEM SETUP"
31
+ log.info "Setname is: " + rspec_system_node_set.setname
32
+ log.info "Configuration is: " + rspec_system_node_set.config.pretty_inspect
33
+ log.info "Virtual Environment type is: #{rspec_system_node_set.env_type}"
34
+
35
+ rspec_system_node_set.setup
36
+ end
37
+
38
+ c.after :suite do
39
+ log.info 'FINALIZE RSPEC-SYSTEM SETUP'
40
+ rspec_system_node_set.teardown
41
+ end
42
+ end
@@ -0,0 +1,17 @@
1
+ type: map
2
+ mapping:
3
+ default_set: { type: str }
4
+ sets:
5
+ type: map
6
+ mapping:
7
+ =:
8
+ type: map
9
+ mapping:
10
+ nodes:
11
+ type: map
12
+ mapping:
13
+ =:
14
+ type: map
15
+ mapping:
16
+ prefab: { type: str }
17
+ role: { type: str }
@@ -2,11 +2,11 @@
2
2
  Gem::Specification.new do |s|
3
3
  # Metadata
4
4
  s.name = "rspec-system"
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
  s.authors = ["Ken Barber"]
7
7
  s.email = ["ken@bob.sh"]
8
8
  s.homepage = "https://github.com/kbarber/rspec-system"
9
- s.summary = "System testing with vagrant"
9
+ s.summary = "System testing with rspec"
10
10
 
11
11
  # Manifest
12
12
  s.files = `git ls-files`.split("\n")
@@ -16,8 +16,8 @@ Gem::Specification.new do |s|
16
16
 
17
17
  # Dependencies
18
18
  s.required_ruby_version = '>= 1.9.3'
19
- s.add_runtime_dependency "vagrant"
20
- s.add_runtime_dependency "sahara"
21
19
  s.add_runtime_dependency "rspec"
20
+ s.add_runtime_dependency "kwalify"
22
21
  s.add_development_dependency "simplecov"
22
+ s.add_development_dependency "mocha"
23
23
  end
@@ -0,0 +1,7 @@
1
+ ---
2
+ default_set: 'centos-58-x64'
3
+ sets:
4
+ 'centos-58-x64':
5
+ nodes:
6
+ "main":
7
+ prefab: 'centos-58-x64'
@@ -0,0 +1,9 @@
1
+ ---
2
+ default_set: 'centos-58-x64'
3
+ sets:
4
+ 'centos-58-x64':
5
+ nodes:
6
+ "master":
7
+ prefab: 'centos-58-x64'
8
+ "agent":
9
+ prefab: 'centos-58-x64'
@@ -0,0 +1,25 @@
1
+ dir = File.expand_path(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift File.join(dir, 'lib')
3
+
4
+ require 'rubygems'
5
+ require 'bundler/setup'
6
+
7
+ Bundler.require :default, :test
8
+
9
+ require 'pathname'
10
+ require 'tmpdir'
11
+
12
+ Pathname.glob("#{dir}/shared_behaviours/**/*.rb") do |behaviour|
13
+ require behaviour.relative_path_from(Pathname.new(dir))
14
+ end
15
+
16
+ def fixture_path
17
+ Pathname.new(File.expand_path(File.join(__FILE__, '..', 'fixtures')))
18
+ end
19
+ def schema_path
20
+ Pathname.new(File.expand_path(File.join(__FILE__, '..', '..', 'resources', 'kwalify-schemas')))
21
+ end
22
+
23
+ RSpec.configure do |config|
24
+ config.mock_with :mocha
25
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+ require 'kwalify'
3
+
4
+ describe 'nodeset_schema' do
5
+ let(:schema) do
6
+ YAML.load_file(schema_path + 'nodeset_schema.yml')
7
+ end
8
+ let(:validator) do
9
+ validator = Kwalify::Validator.new(schema)
10
+ end
11
+ let(:parser) do
12
+ parser = Kwalify::Yaml::Parser.new(validator)
13
+ end
14
+
15
+ # examples = ['nodeset_example1.yml']
16
+ Pathname.glob(fixture_path + 'nodeset_example*.yml').each do |ex|
17
+ it "should not return an error for #{ex.basename}" do
18
+ ydoc = parser.parse_file(fixture_path + ex)
19
+ errors = parser.errors
20
+ if errors && !errors.empty?
21
+ errors.each do |e|
22
+ puts "line=#{e.linenum}, path=#{e.path}, mesg=#{e.message}"
23
+ end
24
+ end
25
+ errors.should == []
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-system
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-23 00:00:00.000000000 Z
12
+ date: 2013-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: vagrant
15
+ name: rspec
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
@@ -28,7 +28,7 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
- name: sahara
31
+ name: kwalify
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
@@ -44,14 +44,14 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
- name: rspec
47
+ name: simplecov
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
51
  - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
- type: :runtime
54
+ type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
@@ -60,7 +60,7 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: simplecov
63
+ name: mocha
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
@@ -85,20 +85,31 @@ files:
85
85
  - .gitignore
86
86
  - .ruby-version
87
87
  - Gemfile
88
- - examples/spec/.gitignore
89
- - examples/spec/system/distros/centos-58-x64_spec.rb
90
- - examples/spec/system/distros/debian-606-x64_spec.rb
91
- - examples/spec/system/tests/test1.rb
92
- - examples/spec/system/tests/test2.rb
93
- - examples/spec/system_spec_helper.rb
94
- - examples/spec/systemtmp/rspec_system_vagrant/centos-58-x64/.vagrant
95
- - examples/spec/systemtmp/rspec_system_vagrant/centos-58-x64/Vagrantfile
88
+ - README.md
89
+ - examples/.gitignore
90
+ - examples/.nodeset.yml
91
+ - examples/.ruby-version
92
+ - examples/Gemfile
93
+ - examples/Rakefile
94
+ - examples/spec/spec_helper.rb
95
+ - examples/spec/system/test1_spec.rb
96
+ - examples/spec/system/test2_spec.rb
97
+ - examples/spec/system/test3_spec.rb
96
98
  - lib/rspec-system.rb
99
+ - lib/rspec-system/formatter.rb
97
100
  - lib/rspec-system/helpers.rb
101
+ - lib/rspec-system/log.rb
98
102
  - lib/rspec-system/node_set.rb
103
+ - lib/rspec-system/node_set/base.rb
99
104
  - lib/rspec-system/node_set/vagrant.rb
100
- - lib/rspec-system/shared_contexts.rb
105
+ - lib/rspec-system/rake_task.rb
106
+ - lib/rspec-system/spec_helper.rb
107
+ - resources/kwalify-schemas/nodeset_schema.yml
101
108
  - rspec-system.gemspec
109
+ - spec/fixtures/nodeset_example1.yml
110
+ - spec/fixtures/nodeset_example2.yml
111
+ - spec/spec_helper.rb
112
+ - spec/unit/kwalify-schemas/nodeset_schema_spec.rb
102
113
  homepage: https://github.com/kbarber/rspec-system
103
114
  licenses: []
104
115
  post_install_message:
@@ -119,8 +130,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
130
  version: '0'
120
131
  requirements: []
121
132
  rubyforge_project:
122
- rubygems_version: 1.8.24
133
+ rubygems_version: 1.8.25
123
134
  signing_key:
124
135
  specification_version: 3
125
- summary: System testing with vagrant
126
- test_files: []
136
+ summary: System testing with rspec
137
+ test_files:
138
+ - spec/unit/kwalify-schemas/nodeset_schema_spec.rb
@@ -1 +0,0 @@
1
- tmp
@@ -1,14 +0,0 @@
1
- require 'system_spec_helper.rb'
2
-
3
- describe "Centos 5.8 x86_64", :scope => :all do
4
- let(:rspec_system_config) do
5
- {
6
- :id => 'centos-58-x64',
7
- :nodes => {
8
- 'main' => {
9
- :prefab => 'centos-58-x64',
10
- }
11
- }
12
- }
13
- end
14
- end
@@ -1,14 +0,0 @@
1
- require 'system_spec_helper'
2
-
3
- describe 'Debian 6.0.6 x86_64', :scope => :all do
4
- let(:rspec_system_config) do
5
- {
6
- :id => 'debian-606-x64',
7
- :nodes => {
8
- 'main' => {
9
- :prefab => 'debian-606-x64',
10
- }
11
- }
12
- }
13
- end
14
- end
@@ -1,11 +0,0 @@
1
- require 'system_spec_helper'
2
-
3
- shared_examples "test2", :scope => :all do
4
- it 'run test2 - part1' do
5
- puts 'test2 - part1'
6
- end
7
-
8
- it 'run test2 - part2' do
9
- puts 'test2 - part2'
10
- end
11
- end
@@ -1,7 +0,0 @@
1
- require 'rspec-system'
2
- require 'system/tests/test1'
3
- require 'system/tests/test2'
4
-
5
- RSpec.configure do |c|
6
- c.rspec_system_vagrant_projects = File.join(File.dirname(__FILE__), 'system', 'tmp', 'rspec_system_vagrant')
7
- end
@@ -1 +0,0 @@
1
- {"active":{"main":"890d1d49-5bac-4373-99ff-7b8b8d144c38"}}
@@ -1,6 +0,0 @@
1
- Vagrant::Config.run do |c| c.vm.define 'main' do |vmconf|
2
- vmconf.vm.box = 'centos-58-x64'
3
- vmconf.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/centos-58-x64.box'
4
-
5
- end
6
- end
@@ -1,44 +0,0 @@
1
- require 'logger'
2
-
3
- shared_context "shared stuff", :scope => :all do
4
- # Grab the type of virtual environment we wish to run these tests in
5
- let(:rspec_virtual_env) do
6
- ENV["RSPEC_VIRTUAL_ENV"] || 'vagrant'
7
- end
8
-
9
- let(:rspec_system_node_set) do
10
- RSpecSystem::NodeSet.new(rspec_system_config, rspec_virtual_env)
11
- end
12
-
13
- let(:rspec_system_logger) do
14
- Logger::DEBUG
15
- end
16
-
17
- before :all do
18
- require 'pp'
19
-
20
- puts "Configuration for now is:"
21
- puts rspec_system_node_set.config.pretty_inspect
22
- puts "Virtual Environment is: #{rspec_system_node_set.virtual_env}"
23
-
24
- rspec_system_node_set.setup
25
-
26
- puts 'before all: setup vms'
27
- puts 'before all: snapshot vms'
28
- end
29
-
30
- before :each do
31
- puts 'before each: roll back vms'
32
- rspec_system_node_set.rollback
33
- end
34
-
35
- after :each do
36
- puts 'after each: roll back vms'
37
- rspec_system_node_set.rollback
38
- end
39
-
40
- after :all do
41
- puts 'after all: shut down all vms'
42
- rspec_system_node_set.teardown
43
- end
44
- end