no_peeping_toms 1.0.0 → 1.0.1

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.rdoc ADDED
@@ -0,0 +1,8 @@
1
+ === Version 1.0.1 / 2010-01-06
2
+
3
+ * official gem release
4
+ * Updated #with_observers to take in class references, or an anonymous observer (Zach Dennis)
5
+ * peeping toms can be re-enabled, specifically for use in Cucumber (Brandon Keepers)
6
+ To enable:
7
+ ActiveRecord::Observer.allow_peeping_toms = true
8
+ * Fixed broken specs. Added fix for exceptions raised in with_observers (Jeff Siegel)
data/README CHANGED
@@ -1,6 +1,8 @@
1
1
  no_peeping_toms
2
2
  =============
3
3
 
4
+ Originally a plugin, now gemified. 'gem install no_peeping_toms'
5
+
4
6
  This plugin disables observers in your specs, so that model specs can run in complete isolation.
5
7
 
6
8
  You can choose to run some code with observers turned on. This is useful when spec'ing an observer. For example, if you write the following observer:
@@ -28,7 +30,7 @@ You can spec the Person class in complete isolation.
28
30
 
29
31
  # Run only a portion of code with certain observers turned on
30
32
  it "should register a name change with the person observer turned on" do
31
- Person.with_observers(:person_observer) do
33
+ ActiveRecord::Observer.with_observers(:person_observer) do
32
34
  lambda { @person.update_attribute :name, "Don Juan Demarco" }.should change(NameChange, :count).by(1)
33
35
  end
34
36
 
@@ -37,4 +39,4 @@ You can spec the Person class in complete isolation.
37
39
  end
38
40
 
39
41
 
40
- Copyright (c) 2007 Pat Maddox, released under the MIT license
42
+ Copyright (c) 2007-2010 Pat Maddox, released under the MIT license
data/Rakefile CHANGED
@@ -14,8 +14,11 @@ Jeweler::Tasks.new do |s|
14
14
  s.summary = "Disables observers during testing, allowing you to write model tests that are completely decoupled from the observer."
15
15
  s.description = s.summary
16
16
  s.email = "pat.maddox@gmail.com"
17
- s.homepage = "http://github.com/pat-maddox"
17
+ s.homepage = "http://github.com/patmaddox/no-peeping-toms"
18
18
  s.authors = ["Pat Maddox", "Brandon Keepers"]
19
19
  s.add_dependency "activerecord", ['>= 1.1']
20
+ s.files -= ['.gitignore', 'init.rb']
20
21
  s.test_files = Dir['spec/**/*']
21
22
  end
23
+
24
+ Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -10,7 +10,6 @@ module NoPeepingToms
10
10
 
11
11
  module InstanceMethods
12
12
  def update_with_neighborhood_watch(*args)
13
- puts "calling tom's #update: #{*args.inspect} -- #{self.class.allow_peeping_toms}"
14
13
  if self.class.allow_peeping_toms || self.class.peeping_toms.include?(self)
15
14
  update_without_neighborhood_watch(*args)
16
15
  end
@@ -1,22 +1,25 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{no_peeping_toms}
5
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["Pat Maddox", "Brandon Keepers"]
9
- s.date = %q{2009-08-17}
12
+ s.date = %q{2010-01-06}
10
13
  s.description = %q{Disables observers during testing, allowing you to write model tests that are completely decoupled from the observer.}
11
14
  s.email = %q{pat.maddox@gmail.com}
12
15
  s.extra_rdoc_files = [
13
16
  "README"
14
17
  ]
15
18
  s.files = [
16
- "README",
19
+ "History.rdoc",
20
+ "README",
17
21
  "Rakefile",
18
22
  "VERSION",
19
- "init.rb",
20
23
  "install.rb",
21
24
  "lib/no_peeping_toms.rb",
22
25
  "no_peeping_toms.gemspec",
@@ -24,13 +27,12 @@ Gem::Specification.new do |s|
24
27
  "spec/db/schema.rb",
25
28
  "spec/no_peeping_toms_spec.rb",
26
29
  "spec/spec_helper.rb",
27
- "tasks/no_peeping_toms_tasks.rake",
28
30
  "uninstall.rb"
29
31
  ]
30
- s.homepage = %q{http://github.com/pat-maddox}
32
+ s.homepage = %q{http://github.com/patmaddox/no-peeping-toms}
31
33
  s.rdoc_options = ["--charset=UTF-8"]
32
34
  s.require_paths = ["lib"]
33
- s.rubygems_version = %q{1.3.3}
35
+ s.rubygems_version = %q{1.3.5}
34
36
  s.summary = %q{Disables observers during testing, allowing you to write model tests that are completely decoupled from the observer.}
35
37
  s.test_files = [
36
38
  "spec/db",
@@ -53,3 +55,4 @@ Gem::Specification.new do |s|
53
55
  s.add_dependency(%q<activerecord>, [">= 1.1"])
54
56
  end
55
57
  end
58
+
data/spec/db/database.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  sqlite3:
2
2
  :adapter: sqlite3
3
- :dbfile: ":memory:"
3
+ :database: ":memory:"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: no_peeping_toms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Maddox
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-08-17 00:00:00 -04:00
13
+ date: 2010-01-06 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -32,10 +32,10 @@ extensions: []
32
32
  extra_rdoc_files:
33
33
  - README
34
34
  files:
35
+ - History.rdoc
35
36
  - README
36
37
  - Rakefile
37
38
  - VERSION
38
- - init.rb
39
39
  - install.rb
40
40
  - lib/no_peeping_toms.rb
41
41
  - no_peeping_toms.gemspec
@@ -43,10 +43,9 @@ files:
43
43
  - spec/db/schema.rb
44
44
  - spec/no_peeping_toms_spec.rb
45
45
  - spec/spec_helper.rb
46
- - tasks/no_peeping_toms_tasks.rake
47
46
  - uninstall.rb
48
47
  has_rdoc: true
49
- homepage: http://github.com/pat-maddox
48
+ homepage: http://github.com/patmaddox/no-peeping-toms
50
49
  licenses: []
51
50
 
52
51
  post_install_message:
@@ -69,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
68
  requirements: []
70
69
 
71
70
  rubyforge_project:
72
- rubygems_version: 1.3.3
71
+ rubygems_version: 1.3.5
73
72
  signing_key:
74
73
  specification_version: 3
75
74
  summary: Disables observers during testing, allowing you to write model tests that are completely decoupled from the observer.
data/init.rb DELETED
@@ -1 +0,0 @@
1
- require 'no_peeping_toms' if "test" == RAILS_ENV
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :no_peeping_toms do
3
- # # Task goes here
4
- # end