rspec-paper_trail 0.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/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ pkg/
12
+ tmp/
13
+
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rspec-paper_trail.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Paul Belt
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Rspec::PaperTrail
2
+
3
+ use paper_trail within rspec, conveniently
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'rspec-paper_trail'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install rspec-paper_trail
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
30
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,5 @@
1
+ module Rspec
2
+ module PaperTrail
3
+ VERSION = '0.0.1'
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ require 'rspec/paper_trail/version'
2
+ require 'rspec/versioning_extensions'
3
+
@@ -0,0 +1,37 @@
1
+ module RspecExtensions
2
+ # :call-seq:
3
+ # with_versioning
4
+ #
5
+ # enable versioning for specific blocks
6
+
7
+ def with_versioning
8
+ was_enabled = PaperTrail.enabled?
9
+ PaperTrail.enabled = true
10
+ begin
11
+ yield
12
+ ensure
13
+ PaperTrail.enabled = was_enabled
14
+ end
15
+ end
16
+ end
17
+
18
+ RSpec.configure do |config|
19
+ config.include RspecExtensions
20
+
21
+ config.before(:each) do
22
+ PaperTrail.enabled = false
23
+ PaperTrail.controller_info = {}
24
+ PaperTrail.whodunnit = nil
25
+ end
26
+
27
+ config.before(:each, versioning: true) do
28
+ PaperTrail.enabled = true
29
+ end
30
+ end
31
+
32
+ RSpec::Matchers.define :be_versioned do
33
+ match do |actual|
34
+ actual.respond_to?(:versions)
35
+ end
36
+ end
37
+
@@ -0,0 +1,41 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'rspec/paper_trail/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'rspec-paper_trail'
9
+ spec.version = Rspec::PaperTrail::VERSION
10
+ spec.authors = ['Paul Belt']
11
+ spec.email = %w(paul.belt@gmail.com)
12
+ spec.description = %q{use paper_trail within rspec, conveniently}
13
+ spec.summary = %q{provides rspec-matcher to ensure versioning and per-spec, per-block versioning}
14
+ spec.homepage = 'https://github.com/belt/rspec-paper_trail'
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = %w(lib)
21
+
22
+ spec.required_ruby_version = Gem::Requirement.new('>= 1.9.2')
23
+ spec.required_rubygems_version = Gem::Requirement.new('>= 0') if spec.respond_to? :required_rubygems_version=
24
+
25
+ if spec.respond_to? :specification_version
26
+ spec.specification_version = 3
27
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0')
28
+ spec.add_runtime_dependency 'paper_trail', ['~> 2.7.1']
29
+
30
+ spec.add_development_dependency 'bundler', ['~> 1.3.0']
31
+ spec.add_development_dependency 'rake'
32
+ else
33
+ spec.add_dependency 'bundler', ['~> 1.3']
34
+ spec.add_dependency 'rake'
35
+ end
36
+ else
37
+ spec.add_dependency 'bundler', ['~> 1.3']
38
+ spec.add_dependency 'rake'
39
+ end
40
+
41
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-paper_trail
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Paul Belt
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-03-12 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: paper_trail
16
+ requirement: &2288192180 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 2.7.1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *2288192180
25
+ - !ruby/object:Gem::Dependency
26
+ name: bundler
27
+ requirement: &2288191700 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 1.3.0
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *2288191700
36
+ - !ruby/object:Gem::Dependency
37
+ name: rake
38
+ requirement: &2288191320 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *2288191320
47
+ description: use paper_trail within rspec, conveniently
48
+ email:
49
+ - paul.belt@gmail.com
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - Gemfile
56
+ - LICENSE.txt
57
+ - README.md
58
+ - Rakefile
59
+ - lib/rspec/paper_trail.rb
60
+ - lib/rspec/paper_trail/version.rb
61
+ - lib/rspec/versioning_extensions.rb
62
+ - rspec-paper_trail.gemspec
63
+ homepage: https://github.com/belt/rspec-paper_trail
64
+ licenses:
65
+ - MIT
66
+ post_install_message:
67
+ rdoc_options: []
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: 1.9.2
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 1.8.10
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: provides rspec-matcher to ensure versioning and per-spec, per-block versioning
88
+ test_files: []