fractal-matchers 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in fractal-matchers.gemspec
4
+ gemspec
data/README.md ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "fractal-matchers/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "fractal-matchers"
7
+ s.version = Fractal::Matchers::VERSION
8
+ s.authors = ["Andrea Campolonghi"]
9
+ s.email = ["acampolonghi@gmail.com"]
10
+ s.homepage = ""
11
+ s.summary = %q{Rspec matchers from fractalgarden.com}
12
+ s.description = %q{Rspec matchers used in fractalgarden.com}
13
+
14
+ s.rubyforge_project = "fractal-matchers"
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_development_dependency "activerecord"
24
+ end
@@ -0,0 +1,2 @@
1
+ require "fractal-matchers/version"
2
+ require "fractal-matchers/rspec_matchers" unless RSpec.nil?
@@ -0,0 +1,6 @@
1
+ # return true is the model accept nested attributes for the passed attribute
2
+ RSpec::Matchers.define :accept_nested_attributes_for do |attribute|
3
+ match do |model|
4
+ model.nested_attributes_options.include? attribute
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Fractal
2
+ module Matchers
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+ require "support/rspec_fractal_matchers"
3
+
4
+ describe "rspec_fractal_matchers" do
5
+
6
+ context "accept_nested_attributes_for" do
7
+
8
+ it "should be true if model accept_nested_attributes_for the passed attribute" do
9
+ Document.should accept_nested_attributes_for(:section)
10
+ end
11
+
12
+ it "should be false if model accept_nested_attributes_for the passed attribute" do
13
+ Document.should_not accept_nested_attributes_for(:users)
14
+ end
15
+
16
+ end
17
+
18
+ end
@@ -0,0 +1,13 @@
1
+ require "fractal-matchers"
2
+
3
+ # This file was generated by the `rspec --init` command. Conventionally, all
4
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
+ # Require this file using `require "spec_helper.rb"` to ensure that it is only
6
+ # loaded once.
7
+ #
8
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
9
+ RSpec.configure do |config|
10
+ config.treat_symbols_as_metadata_keys_with_true_values = true
11
+ config.run_all_when_everything_filtered = true
12
+ config.filter_run :focus
13
+ end
@@ -0,0 +1,10 @@
1
+ require "active_record"
2
+
3
+ class Section < ActiveRecord::Base
4
+ end
5
+
6
+ class Document < ActiveRecord::Base
7
+ has_one :section
8
+ accepts_nested_attributes_for :section
9
+ end
10
+
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fractal-matchers
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Andrea Campolonghi
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-02-05 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70237030556760 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: *70237030556760
25
+ - !ruby/object:Gem::Dependency
26
+ name: activerecord
27
+ requirement: &70237030555980 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :development
34
+ prerelease: false
35
+ version_requirements: *70237030555980
36
+ description: Rspec matchers used in fractalgarden.com
37
+ email:
38
+ - acampolonghi@gmail.com
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - .gitignore
44
+ - .rspec
45
+ - Gemfile
46
+ - README.md
47
+ - Rakefile
48
+ - fractal-matchers.gemspec
49
+ - lib/fractal-matchers.rb
50
+ - lib/fractal-matchers/rspec_matchers.rb
51
+ - lib/fractal-matchers/version.rb
52
+ - spec/rspec_matchers_spec.rb
53
+ - spec/spec_helper.rb
54
+ - spec/support/rspec_fractal_matchers.rb
55
+ homepage: ''
56
+ licenses: []
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubyforge_project: fractal-matchers
75
+ rubygems_version: 1.8.10
76
+ signing_key:
77
+ specification_version: 3
78
+ summary: Rspec matchers from fractalgarden.com
79
+ test_files:
80
+ - spec/rspec_matchers_spec.rb
81
+ - spec/spec_helper.rb
82
+ - spec/support/rspec_fractal_matchers.rb
83
+ has_rdoc: