machinery 0.9.3 → 0.9.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/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Lawrence Pit
1
+ Copyright (c) 2009-2011 Lawrence Pit
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.markdown CHANGED
@@ -205,4 +205,4 @@ Machinery works especially pleasurable in combination with
205
205
 
206
206
 
207
207
  ----
208
- Copyright (c) 2009 Lawrence Pit, released under the MIT license
208
+ Copyright (c) 2009-2011 Lawrence Pit, released under the MIT license
@@ -10,11 +10,13 @@ module Machinery
10
10
  end
11
11
 
12
12
  def self.clear
13
- @@toys.each do |toy|
14
- toy.connection.delete(
15
- "DELETE FROM #{toy.class.quoted_table_name} " +
16
- "WHERE #{toy.connection.quote_column_name(toy.class.primary_key)} = #{toy.quoted_id}",
17
- "#{toy.class.name} Destroy"
13
+ @@toys.each do |toy|
14
+ clazz = toy.class
15
+ conn = toy.connection
16
+ conn.delete(
17
+ "DELETE FROM #{clazz.quoted_table_name} " +
18
+ "WHERE #{conn.quote_column_name(clazz.primary_key)} = #{toy.quoted_id}",
19
+ "#{clazz.name} Destroy"
18
20
  )
19
21
  end
20
22
  @@toys = []
data/lib/machinery.rb CHANGED
@@ -73,7 +73,10 @@ if defined? Test::Unit::TestCase
73
73
  Test::Unit::TestCase.send('include', Machinery::Helpers)
74
74
  end
75
75
 
76
- if defined? Spec::Example::ExampleGroup
76
+ if defined? RSpec
77
+ RSpec.configure { |c| c.include Machinery::Helpers }
78
+ RSpec::Core::ExampleGroup.extend Machinery::ExampleGroupMacros
79
+ elsif defined? Spec::Example::ExampleGroup
77
80
  Spec::Example::ExampleGroup.extend Machinery::ExampleGroupMacros
78
81
  Spec::Example::ExampleGroupFactory[nil].send('include', Machinery::Helpers)
79
82
  end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machinery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ hash: 51
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 4
10
+ version: 0.9.4
5
11
  platform: ruby
6
12
  authors:
7
13
  - Lawrence Pit
@@ -9,7 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-11-02 00:00:00 +11:00
18
+ date: 2011-03-16 00:00:00 +11:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
@@ -36,21 +42,27 @@ rdoc_options: []
36
42
  require_paths:
37
43
  - lib
38
44
  required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
39
46
  requirements:
40
47
  - - ">="
41
48
  - !ruby/object:Gem::Version
49
+ hash: 3
50
+ segments:
51
+ - 0
42
52
  version: "0"
43
- version:
44
53
  required_rubygems_version: !ruby/object:Gem::Requirement
54
+ none: false
45
55
  requirements:
46
56
  - - ">="
47
57
  - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
48
61
  version: "0"
49
- version:
50
62
  requirements: []
51
63
 
52
64
  rubyforge_project:
53
- rubygems_version: 1.3.5
65
+ rubygems_version: 1.5.2
54
66
  signing_key:
55
67
  specification_version: 3
56
68
  summary: Machinery to create object graphs and speed up tests. No fixtures, no funny magic, just easy and fast plain old ruby.