rspec-situations 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,18 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
-
4
3
  gemspec
5
-
6
-
7
- gem 'rake'
8
- gem 'rspec'
9
- gem 'bundler'
10
-
11
-
12
- group :development do
13
- gem 'growl'
14
- gem 'debugger'
15
- gem 'guard'
16
- gem 'guard-bundler'
17
- gem 'guard-rspec'
18
- end
data/README.md CHANGED
@@ -6,6 +6,20 @@ Using Rspec Situations
6
6
  Using Rspec Situations is super simple.
7
7
 
8
8
 
9
+ In your Gemfile:
10
+ ```ruby
11
+ group :development, :testing do
12
+ gem 'rspec-situations'
13
+ end
14
+ ```
15
+
16
+
17
+ In your spec_helper.rb:
18
+ ```ruby
19
+ require 'rspec/situations'
20
+ ```
21
+
22
+
9
23
  Define a situation with the 'situation' method.
10
24
  Add a symbol key to identify the situation, and add an optional description if you like, and pass in a block creating the situation.
11
25
 
@@ -15,23 +29,25 @@ Describe a set of 1 or more situations with the 'describe_situation' method, and
15
29
 
16
30
  ```ruby
17
31
  describe Apple do
18
- subject( :apple ){ create :apple }
32
+ subject( :apple ){ create :apple }
19
33
 
20
- situation( :bought ){ subject.bought_by = create :user }
21
- situation( :red ){ subject.color = :red }
34
+ situation( :bought ){ subject.bought_by = create :user }
35
+ situation( :red ){ subject.color = :red }
22
36
 
23
- situation( :one_yr_old, 'a year old' ){ subject.created_at = 1.years.ago } # With optional description
37
+ situation( :one_yr_old, 'a year old' ) do # With optional description
38
+ subject.created_at = 1.years.ago
39
+ end
24
40
 
25
- describe_situation :bought, :red do
26
- it{ should be_tasty }
27
- end
41
+ describe_situation :bought, :red do
42
+ it{ should be_tasty }
43
+ end
28
44
 
29
- describe_situation :bought, :one_yr_old, 'bought a year ago' do # With optional description
30
- it{ should_not be_tasty }
31
- end
45
+ desribe_situation :bought, :one_yr_old, 'bought a year ago' do # With optional description
46
+ it{ should_not be_tasty }
47
+ end
32
48
 
33
- describe_situation :bought, :one_yr_old do
34
- it{ should_not be_tasty }
35
- end
49
+ describe_situation :bought, :one_yr_old do
50
+ it{ should_not be_tasty }
51
+ end
36
52
  end
37
53
  ```
@@ -1,6 +1,6 @@
1
1
  module RSpec
2
- module Situations
3
- end
2
+ module Situations
3
+ end
4
4
  end
5
5
 
6
6
  require 'rspec/situations/version'
@@ -1,6 +1,6 @@
1
1
  require 'rspec'
2
2
 
3
3
  RSpec.configure do |c|
4
- c.extend RSpec::Situations::ClassExtensions
5
- c.include RSpec::Situations::InstanceExtensions
4
+ c.extend RSpec::Situations::ClassExtensions
5
+ c.include RSpec::Situations::InstanceExtensions
6
6
  end
@@ -10,7 +10,7 @@ module RSpec::Situations::InstanceExtensions
10
10
  def _rsits( *keys ) # Go up the example parents and get the situations requested, whereever they may be defined
11
11
  _rsits_combined_hash.select do |key, _|
12
12
  keys.include? key # Then filter out only the keys we are using
13
- end.map{ |_, situation| situation } # Now return an array of situations instead of a hash
13
+ end.values # Now return an array of situations instead of a hash
14
14
  end
15
15
 
16
16
 
@@ -1,6 +1,6 @@
1
1
  module RSpec::Situations
2
2
 
3
- class Situation
3
+ class Situation # Simple value-object to respresent a situation
4
4
  attr_reader :description, :block
5
5
 
6
6
  def initialize( key, description = nil, &block )
@@ -4,7 +4,7 @@ module RSpec
4
4
  VERSION_NUMBERS = [
5
5
  VERSION_MAJOR = 0,
6
6
  VERSION_MINOR = 0,
7
- VERSION_BUILD = 4
7
+ VERSION_BUILD = 5
8
8
  ]
9
9
 
10
10
  VERSION = VERSION_NUMBERS.join '.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-situations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,6 +59,54 @@ dependencies:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: guard
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: guard-rspec
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: growl
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
62
110
  description: Adds a super simple method to describe RSpec situations in terms of smaller
63
111
  situation blocks.
64
112
  email: