rspec-system 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  require 'rspec'
2
2
 
3
+ # Root module namespace for +rspec-system+
3
4
  module RSpecSystem; end
4
5
 
5
6
  require 'rspec-system/log'
@@ -7,12 +8,3 @@ require 'rspec-system/helpers'
7
8
  require 'rspec-system/node_set'
8
9
  require 'rspec-system/prefab'
9
10
  require 'rspec-system/node'
10
-
11
- RSpec::configure do |c|
12
- c.include RSpecSystem::Helpers
13
-
14
- # This provides a path to save vagrant files
15
- c.add_setting :system_tmp
16
- # Block to execute for environment setup
17
- c.add_setting :system_setup_block
18
- end
@@ -12,10 +12,15 @@ module RSpecSystem
12
12
  # has started and finished. It also attempts to use color for visibility
13
13
  # as well as listing test case information in a more verbose way.
14
14
  class Formatter < RSpec::Core::Formatters::BaseTextFormatter
15
+ # Initialize formatter
15
16
  def initialize(output)
16
17
  super(output)
17
18
  end
18
19
 
20
+ # Display test start information
21
+ #
22
+ # @param count [Fixnum] number of tests to run
23
+ # @return [void]
19
24
  def start(count)
20
25
  super(count)
21
26
  output << "=================================================================\n\n"
@@ -23,17 +28,29 @@ module RSpecSystem
23
28
  output << bold("Total Test Count: ") << color(count, :cyan) << "\n\n"
24
29
  end
25
30
 
31
+ # Display output when an example has started
32
+ #
33
+ # @param example [RSpec::Core::Example] example that is running
34
+ # @return [void]
26
35
  def example_started(example)
27
36
  super(example)
28
37
  output << "=================================================================\n\n"
29
38
  output << bold("Running test:\n ") << color(example.full_description, :magenta) << "\n\n"
30
39
  end
31
40
 
41
+ # Display output when an example has passed
42
+ #
43
+ # @param example [RSpec::Core::Example] example that is running
44
+ # @return [void]
32
45
  def example_passed(example)
33
46
  super(example)
34
47
  output << "\n" << bold('Result: ') << success_color('passed') << "\n\n"
35
48
  end
36
49
 
50
+ # Display output when an example is pending
51
+ #
52
+ # @param example [RSpec::Core::Example] example that is running
53
+ # @return [void]
37
54
  def example_pending(example)
38
55
  super(example)
39
56
  msg = example.execution_result[:pending_message]
@@ -41,6 +58,10 @@ module RSpecSystem
41
58
  output << bold("Reason: ") << "#{msg}\n\n"
42
59
  end
43
60
 
61
+ # Display output when an example has failed
62
+ #
63
+ # @param example [RSpec::Core::Example] example that is running
64
+ # @return [void]
44
65
  def example_failed(example)
45
66
  super(example)
46
67
  msg = example.execution_result[:exception]
@@ -49,6 +70,10 @@ module RSpecSystem
49
70
  output << bold("Reason:\n") << "#{msg}\n\n"
50
71
  end
51
72
 
73
+ # Obtains next index value so we can keep a count of what test we are upto
74
+ #
75
+ # @api private
76
+ # @return [Fixnum] index #
52
77
  def next_failure_index
53
78
  @next_failure_index ||= 0
54
79
  @next_failure_index += 1
@@ -2,6 +2,9 @@ module RSpecSystem
2
2
  # Factory class for NodeSet.
3
3
  class NodeSet
4
4
  # Returns a NodeSet object.
5
+ #
6
+ # @return [RSpecSystem::NodeSet::Base] returns an object based on the Base
7
+ # abstract class.
5
8
  def self.create(setname, config, virtual_env)
6
9
  case(virtual_env)
7
10
  when 'vagrant'
@@ -1,4 +1,5 @@
1
1
  module RSpecSystem
2
+ # This object represents a prefab definition from the prefabs.yml file
2
3
  class Prefab
3
4
  attr_reader :name
4
5
  attr_reader :description
@@ -1,3 +1,5 @@
1
+ # Include this file to create the spec:* rake tasks
2
+
1
3
  require 'rubygems'
2
4
  require "bundler/setup"
3
5
 
@@ -1,3 +1,6 @@
1
+ # This file provides a require-able entry point for putting at the top of your
2
+ # tests, or in a shared helper.
3
+
1
4
  require 'rspec-system'
2
5
  require 'yaml'
3
6
  require 'pp'
@@ -5,6 +8,12 @@ require 'tempfile'
5
8
 
6
9
  RSpec.configure do |c|
7
10
  include RSpecSystem::Log
11
+ c.include RSpecSystem::Helpers
12
+
13
+ # This provides a path to save vagrant files
14
+ c.add_setting :system_tmp
15
+ # Block to execute for environment setup
16
+ c.add_setting :system_setup_block
8
17
 
9
18
  def nodeset
10
19
  Pathname.new(File.join(File.basename(__FILE__), '..', '.nodeset.yml'))
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  # Metadata
4
4
  s.name = "rspec-system"
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
  s.authors = ["Ken Barber"]
7
7
  s.email = ["ken@bob.sh"]
8
8
  s.homepage = "https://github.com/kbarber/rspec-system"
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.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-30 00:00:00.000000000 Z
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec