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.
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/README.md +45 -0
- data/examples/.gitignore +1 -0
- data/examples/.nodeset.yml +7 -0
- data/examples/.ruby-version +1 -0
- data/examples/Gemfile +6 -0
- data/examples/Rakefile +6 -0
- data/examples/spec/spec_helper.rb +1 -0
- data/examples/spec/system/{tests/test1.rb → test1_spec.rb} +2 -4
- data/examples/spec/system/test2_spec.rb +9 -0
- data/examples/spec/system/test3_spec.rb +13 -0
- data/lib/rspec-system.rb +4 -2
- data/lib/rspec-system/formatter.rb +47 -0
- data/lib/rspec-system/helpers.rb +4 -1
- data/lib/rspec-system/log.rb +13 -0
- data/lib/rspec-system/node_set.rb +7 -25
- data/lib/rspec-system/node_set/base.rb +36 -0
- data/lib/rspec-system/node_set/vagrant.rb +39 -38
- data/lib/rspec-system/rake_task.rb +17 -0
- data/lib/rspec-system/spec_helper.rb +42 -0
- data/resources/kwalify-schemas/nodeset_schema.yml +17 -0
- data/rspec-system.gemspec +4 -4
- data/spec/fixtures/nodeset_example1.yml +7 -0
- data/spec/fixtures/nodeset_example2.yml +9 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/unit/kwalify-schemas/nodeset_schema_spec.rb +28 -0
- metadata +31 -19
- data/examples/spec/.gitignore +0 -1
- data/examples/spec/system/distros/centos-58-x64_spec.rb +0 -14
- data/examples/spec/system/distros/debian-606-x64_spec.rb +0 -14
- data/examples/spec/system/tests/test2.rb +0 -11
- data/examples/spec/system_spec_helper.rb +0 -7
- data/examples/spec/systemtmp/rspec_system_vagrant/centos-58-x64/.vagrant +0 -1
- data/examples/spec/systemtmp/rspec_system_vagrant/centos-58-x64/Vagrantfile +0 -6
- data/lib/rspec-system/shared_contexts.rb +0 -44
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-1.9.3
|
1
|
+
ruby-1.9.3@rspec-system
|
data/Gemfile
CHANGED
data/README.md
ADDED
@@ -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`.
|
data/examples/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
spec/system/tmp
|
@@ -0,0 +1 @@
|
|
1
|
+
ruby-1.9.3-p392@rspec-system-example
|
data/examples/Gemfile
ADDED
data/examples/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'rspec-system/spec_helper'
|
@@ -1,13 +1,11 @@
|
|
1
|
-
require '
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
|
-
|
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
|
data/lib/rspec-system.rb
CHANGED
@@ -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 :
|
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
|
data/lib/rspec-system/helpers.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
module RSpecSystem::Helpers
|
2
2
|
def run_on(dest, command)
|
3
|
-
|
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
|
@@ -1,35 +1,17 @@
|
|
1
1
|
module RSpecSystem
|
2
|
+
# Factory class for NodeSet.
|
2
3
|
class NodeSet
|
3
|
-
|
4
|
-
|
5
|
-
|
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(
|
8
|
+
RSpecSystem::NodeSet::Vagrant.new(setname, config)
|
12
9
|
else
|
13
|
-
raise "Unsupported virtual environment #{
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
-
|
13
|
-
|
17
|
+
log.info "Begin setting up vagrant"
|
18
|
+
create_vagrantfile
|
14
19
|
|
15
|
-
|
16
|
-
|
17
|
-
puts "running vagrant up"
|
18
|
-
@vagrant_env.cli("up")
|
20
|
+
log.info "Running 'vagrant destroy'"
|
21
|
+
vagrant("destroy", "--force")
|
19
22
|
|
20
|
-
|
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
|
-
|
25
|
-
|
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
|
-
|
46
|
-
result
|
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
|
54
|
-
|
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[
|
59
|
-
|
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
|
-
#{
|
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
|
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
|
data/rspec-system.gemspec
CHANGED
@@ -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.
|
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
|
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
|
data/spec/spec_helper.rb
ADDED
@@ -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.
|
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-
|
12
|
+
date: 2013-03-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
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:
|
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:
|
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: :
|
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:
|
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
|
-
-
|
89
|
-
- examples
|
90
|
-
- examples
|
91
|
-
- examples
|
92
|
-
- examples/
|
93
|
-
- examples/
|
94
|
-
- examples/spec/
|
95
|
-
- examples/spec/
|
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/
|
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.
|
133
|
+
rubygems_version: 1.8.25
|
123
134
|
signing_key:
|
124
135
|
specification_version: 3
|
125
|
-
summary: System testing with
|
126
|
-
test_files:
|
136
|
+
summary: System testing with rspec
|
137
|
+
test_files:
|
138
|
+
- spec/unit/kwalify-schemas/nodeset_schema_spec.rb
|
data/examples/spec/.gitignore
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
tmp
|
@@ -1 +0,0 @@
|
|
1
|
-
{"active":{"main":"890d1d49-5bac-4373-99ff-7b8b8d144c38"}}
|
@@ -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
|