phillumeny 0.0.1.placeholder → 0.0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cd6a8b36f5670c7e794873130c9099621e340b31
4
+ data.tar.gz: 5a73eafa65e6faa7a4abf574c418c36404a2b460
5
+ SHA512:
6
+ metadata.gz: b83a4255c5241e13b4a3a3f6eef57fd0999e77173c8eaddd2c8fb12d7d24f0f9604d4bd8eb0bc652792888bf8b36de204bc54b2c109d378f8991dc9a12a3c297
7
+ data.tar.gz: 54cdca03198280053a2e14f157f61db56fb7b9b823b45c91592398b9a905606eeb85cda8e3aab64a460d4d8ec4fac98d2804f5adbb4d0f9688f459eee52023e3
@@ -0,0 +1,51 @@
1
+ module Phillumeny
2
+
3
+ # Matchers for supporting the validation of factories along with their
4
+ # traits and build strategies
5
+ module FactoryGirl
6
+
7
+ # rubocop:disable PredicateName
8
+ def have_a_valid_factory(name = nil)
9
+ HaveAValidFactory.new(name)
10
+ end
11
+ # rubocop:enable PredicateName
12
+
13
+ # it { should_not have_a_valid_factory }
14
+ # it { should have_a_valid_factory.with_trait(:valid) }
15
+ class HaveAValidFactory
16
+
17
+ def description
18
+ msg = "have a valid factory '#{@name}'"
19
+ msg << " with the trait '#{@trait}'" if @trait
20
+ msg
21
+ end
22
+
23
+ def failure_message
24
+ "The '#{@name}' factory did not pass validation.\n#{@error_messages.join("\n")}"
25
+ end
26
+
27
+ def failure_message_when_negated
28
+ "The '#{@name}' factory passed validation unexpectedly"
29
+ end
30
+
31
+ def initialize(name = nil)
32
+ @name = name
33
+ @trait = nil
34
+ end
35
+
36
+ def matches?(subject)
37
+ factory_name = @name = @name.nil? ? subject.class.to_s.underscore : @name
38
+ object = ::FactoryGirl.build(factory_name, @trait)
39
+ @error_messages = object.errors.full_messages unless object.valid?
40
+ object.valid?
41
+ end
42
+
43
+ def with_trait(trait)
44
+ @trait = trait
45
+ self
46
+ end
47
+
48
+ end
49
+
50
+ end
51
+ end
@@ -1,3 +1,20 @@
1
1
  module Phillumeny
2
- VERSION = "0.0.1.placeholder"
2
+
3
+ # Nothing to special to see here. Doing my best to follow semantic versioning that conform
4
+ # with Rubygems/bundler dependency determinations
5
+ module Version
6
+
7
+ MAJOR = 0
8
+ MINOR = 0
9
+ PATCH = 1
10
+ PRERELEASE = nil
11
+ # PRERELEASE = 'alpha'.freeze
12
+ BUILD = 0
13
+
14
+ def self.to_s
15
+ [MAJOR, MINOR, PATCH, PRERELEASE, BUILD].compact.join('.')
16
+ end
17
+
18
+ end
19
+
3
20
  end
data/lib/phillumeny.rb CHANGED
@@ -1,5 +1,8 @@
1
- require "phillumeny/version"
1
+ require 'phillumeny/version'
2
2
 
3
+ require 'phillumeny/factory_girl'
4
+
5
+ # Phillumeny is a collection of RSpec matchers for verbose testers that I use to fills some of the gaps
6
+ # left by other gems in my current preferred Rails stack
3
7
  module Phillumeny
4
- # Your code goes here...
5
8
  end
metadata CHANGED
@@ -1,53 +1,60 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phillumeny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.placeholder
5
- prerelease: 6
4
+ version: 0.0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael Deering
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-02-04 00:00:00.000000000 Z
13
- dependencies: []
14
- description: A supplement of missing matchers for the shoulda collection for those
15
- who really like to test everything including the framework.
11
+ date: 2016-01-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description:
16
28
  email:
17
29
  - mdeering@mdeering.com
18
30
  executables: []
19
31
  extensions: []
20
32
  extra_rdoc_files: []
21
33
  files:
22
- - .gitignore
23
- - Gemfile
24
- - README
25
- - Rakefile
26
34
  - lib/phillumeny.rb
35
+ - lib/phillumeny/factory_girl.rb
27
36
  - lib/phillumeny/version.rb
28
- - phillumeny.gemspec
29
- homepage: ''
37
+ homepage: https://github.com/mdeering/phillumeny
30
38
  licenses: []
39
+ metadata: {}
31
40
  post_install_message:
32
41
  rdoc_options: []
33
42
  require_paths:
34
43
  - lib
35
44
  required_ruby_version: !ruby/object:Gem::Requirement
36
- none: false
37
45
  requirements:
38
- - - ! '>='
46
+ - - ">="
39
47
  - !ruby/object:Gem::Version
40
48
  version: '0'
41
49
  required_rubygems_version: !ruby/object:Gem::Requirement
42
- none: false
43
50
  requirements:
44
- - - ! '>'
51
+ - - ">="
45
52
  - !ruby/object:Gem::Version
46
- version: 1.3.1
53
+ version: '0'
47
54
  requirements: []
48
- rubyforge_project: phillumeny
49
- rubygems_version: 1.8.15
55
+ rubyforge_project:
56
+ rubygems_version: 2.4.8
50
57
  signing_key:
51
- specification_version: 3
58
+ specification_version: 4
52
59
  summary: Collection of RSpec matchers for verbose testers.
53
60
  test_files: []
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in phillumeny.gemspec
4
- gemspec
data/README DELETED
File without changes
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
data/phillumeny.gemspec DELETED
@@ -1,24 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "phillumeny/version"
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "phillumeny"
7
- s.version = Phillumeny::VERSION
8
- s.authors = ["Michael Deering"]
9
- s.email = ["mdeering@mdeering.com"]
10
- s.homepage = ""
11
- s.summary = %q{Collection of RSpec matchers for verbose testers.}
12
- s.description = %q{A supplement of missing matchers for the shoulda collection for those who really like to test everything including the framework.}
13
-
14
- s.rubyforge_project = "phillumeny"
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ["lib"]
20
-
21
- # specify any dependencies here; for example:
22
- # s.add_development_dependency "rspec"
23
- # s.add_runtime_dependency "rest-client"
24
- end