coulda 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/HISTORY CHANGED
@@ -47,3 +47,8 @@ Cleanup
47
47
  -----
48
48
  - Put missing rake task in the gemspec
49
49
  - Added examples that were previously in the git repo but not in the gemspec
50
+
51
+ 0.4.4
52
+ -----
53
+ - Reversed decision on naming "feature" files as _feature.rb. Should just be _test.rb like any other test
54
+ - Features now register with a World when they are created which is used in the rake task instead of ObjectSpace.each_object
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.4.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{coulda}
8
- s.version = "0.4.3"
8
+ s.version = "0.4.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Evan David Light"]
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
34
34
  "lib/coulda.rb",
35
35
  "lib/coulda/feature.rb",
36
36
  "lib/coulda/scenario.rb",
37
+ "lib/coulda/world.rb",
37
38
  "lib/coulda/tasks.rb",
38
39
  "lib/coulda/tasks/print_features.rake",
39
40
  "lib/coulda/vendor/constantize.rb",
@@ -7,6 +7,7 @@ require 'test/unit'
7
7
  gem 'pending', '>= 0.1.1'
8
8
  require 'pending'
9
9
 
10
+ require 'coulda/world'
10
11
  require 'coulda/feature'
11
12
  require 'coulda/scenario'
12
13
  require 'coulda/vendor/constantize'
@@ -10,6 +10,7 @@ module Coulda
10
10
  attr_accessor :current_scenario
11
11
 
12
12
  def initialize(name, opts = {})
13
+ World.register_feature(self)
13
14
  @name = name
14
15
  @scenarios = []
15
16
  Scenario.testcase_class = opts[:testcase_class] if opts[:testcase_class]
@@ -9,19 +9,17 @@ namespace :coulda do
9
9
  # bug in test unit. Set to true to stop from running.
10
10
  Test::Unit.run = true
11
11
 
12
- test_files = Dir.glob(File.join('test', '**', '*_feature.rb'))
12
+ test_files = Dir.glob(File.join('test', '**', '*_test.rb'))
13
13
  test_files.each do |file|
14
14
  load file
15
15
  end
16
16
 
17
- ObjectSpace.each_object do |obj|
18
- next unless obj.is_a? Feature
19
-
20
- puts "Feature: #{obj.name}"
21
- puts " In order to #{obj.in_order_to}" if obj.in_order_to
22
- puts " As a #{obj.as_a}" if obj.as_a
23
- puts " I want to #{obj.i_want_to}" if obj.i_want_to
24
- obj.scenarios.each do |scenario|
17
+ Coulda::World.features.each do |feature|
18
+ puts "Feature: #{feature.name}"
19
+ puts " In order to #{feature.in_order_to}" if feature.in_order_to
20
+ puts " As a #{feature.as_a}" if feature.as_a
21
+ puts " I want to #{feature.i_want_to}" if feature.i_want_to
22
+ feature.scenarios.each do |scenario|
25
23
  puts
26
24
  puts " Scenario: #{scenario.name} #{scenario.pending? ? '(pending)' : ''}"
27
25
  scenario.statements.each do |stmt|
@@ -0,0 +1,11 @@
1
+ module Coulda
2
+ class World
3
+ def self.register_feature(feature)
4
+ (@features ||= []) << feature
5
+ end
6
+
7
+ def self.features
8
+ @features || []
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coulda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan David Light
@@ -49,6 +49,7 @@ files:
49
49
  - lib/coulda.rb
50
50
  - lib/coulda/feature.rb
51
51
  - lib/coulda/scenario.rb
52
+ - lib/coulda/world.rb
52
53
  - lib/coulda/tasks.rb
53
54
  - lib/coulda/tasks/print_features.rake
54
55
  - lib/coulda/vendor/constantize.rb