shoulda-kept-assign-to 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- M2UzZGIwY2ZhMTJlZmNhMTU2ZDZmM2ExNGUwMzgxY2IwNTcwNTYzOQ==
5
- data.tar.gz: !binary |-
6
- ZTAwYWQ2MGNjZWRlY2UwZjJhMTMyMWIxNDNmNGRkZmE3NDk2MDM1Ng==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OTM4MjcxNmFlZTNmZjc3NjBlNzlkMTU3ZTA3ZjlhNTZlOTRiNDQ1ZGU4ZjFh
10
- ODNlZjZmNTk2YTJiYTNkMjRmYmM2MzA4M2ZjNTM1MmI0ZDAxMWFjZDY0OTYw
11
- YTk2MDM0M2E0YzNmOTU1ZmRiZjM5MmViZWZjZDA1YzVjYjJkM2M=
12
- data.tar.gz: !binary |-
13
- NDNkMjliNDQ1ODljNzQ5MjAyYzJjZDVkMWYzODVlZGU1ZTFiNTJlMTE5MTZj
14
- MmIxNTkyMGM1MGQ3ZTc0M2JjMDJjMjQwZjYwNjJhZWQ0N2UyYjBkN2JjMTgz
15
- YmFjMmI3ZWVhZjA0ZDlmMDA4MzgyNTFkMzNhZDFkZDlmZTdlMjQ=
2
+ SHA1:
3
+ metadata.gz: c4bac609c300eb4816ac04b17ec411c09c3e2ca8
4
+ data.tar.gz: f077f74e1a47f2e30baef511bd572c5334c76842
5
+ SHA512:
6
+ metadata.gz: f8358024ab1593291cd40d1616af7fb074b93b18fb673d22afe609335db53bfe1d40b40dbd9e06219aeba22ae1cde50274907f438854d89ce03c7ddb53192d2c
7
+ data.tar.gz: e865533bae3ebbb0a507bd306b55d2cd6674fd5c7c5bf8becb907f02448c64e7b8d6c7eb7c0fe6af0f0b5cefe15a45b0ed5631c0ff02d858ef467c013866b3e9
@@ -0,0 +1,15 @@
1
+ appraise '3.0' do
2
+ gem 'rails', '~> 3.0'
3
+ end
4
+
5
+ appraise '3.1' do
6
+ gem 'rails', '~> 3.1'
7
+ gem 'jquery-rails'
8
+ gem 'sass-rails'
9
+ end
10
+
11
+ appraise '3.2' do
12
+ gem 'rails', '~> 3.2'
13
+ gem 'jquery-rails'
14
+ gem 'sass-rails'
15
+ end
@@ -1,25 +1,116 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shoulda-kept-assign-to (2.1.0)
4
+ shoulda-kept-assign-to (1.0.1)
5
5
  shoulda-matchers (>= 2.1.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (3.2.13)
11
- i18n (= 0.6.1)
10
+ actionmailer (3.2.17)
11
+ actionpack (= 3.2.17)
12
+ mail (~> 2.5.4)
13
+ actionpack (3.2.17)
14
+ activemodel (= 3.2.17)
15
+ activesupport (= 3.2.17)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.17)
24
+ activesupport (= 3.2.17)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.17)
27
+ activemodel (= 3.2.17)
28
+ activesupport (= 3.2.17)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.17)
32
+ activemodel (= 3.2.17)
33
+ activesupport (= 3.2.17)
34
+ activesupport (3.2.17)
35
+ i18n (~> 0.6, >= 0.6.4)
12
36
  multi_json (~> 1.0)
13
- i18n (0.6.1)
14
- multi_json (1.7.4)
15
- rake (10.0.3)
16
- shoulda-matchers (2.1.0)
37
+ appraisal (0.5.2)
38
+ bundler
39
+ rake
40
+ arel (3.0.3)
41
+ builder (3.0.4)
42
+ diff-lcs (1.2.5)
43
+ erubis (2.7.0)
44
+ hike (1.2.3)
45
+ i18n (0.6.9)
46
+ journey (1.0.4)
47
+ json (1.8.1)
48
+ mail (2.5.4)
49
+ mime-types (~> 1.16)
50
+ treetop (~> 1.4.8)
51
+ mime-types (1.25.1)
52
+ multi_json (1.9.0)
53
+ polyglot (0.3.4)
54
+ rack (1.4.5)
55
+ rack-cache (1.2)
56
+ rack (>= 0.4)
57
+ rack-ssl (1.3.3)
58
+ rack
59
+ rack-test (0.6.2)
60
+ rack (>= 1.0)
61
+ rails (3.2.17)
62
+ actionmailer (= 3.2.17)
63
+ actionpack (= 3.2.17)
64
+ activerecord (= 3.2.17)
65
+ activeresource (= 3.2.17)
66
+ activesupport (= 3.2.17)
67
+ bundler (~> 1.0)
68
+ railties (= 3.2.17)
69
+ railties (3.2.17)
70
+ actionpack (= 3.2.17)
71
+ activesupport (= 3.2.17)
72
+ rack-ssl (~> 1.3.2)
73
+ rake (>= 0.8.7)
74
+ rdoc (~> 3.4)
75
+ thor (>= 0.14.6, < 2.0)
76
+ rake (10.1.1)
77
+ rdoc (3.12.2)
78
+ json (~> 1.4)
79
+ rspec-core (2.14.8)
80
+ rspec-expectations (2.14.5)
81
+ diff-lcs (>= 1.1.3, < 2.0)
82
+ rspec-mocks (2.14.6)
83
+ rspec-rails (2.14.1)
84
+ actionpack (>= 3.0)
85
+ activemodel (>= 3.0)
86
+ activesupport (>= 3.0)
87
+ railties (>= 3.0)
88
+ rspec-core (~> 2.14.0)
89
+ rspec-expectations (~> 2.14.0)
90
+ rspec-mocks (~> 2.14.0)
91
+ shoulda-matchers (2.5.0)
17
92
  activesupport (>= 3.0.0)
93
+ sprockets (2.2.2)
94
+ hike (~> 1.2)
95
+ multi_json (~> 1.0)
96
+ rack (~> 1.0)
97
+ tilt (~> 1.1, != 1.3.0)
98
+ sqlite3 (1.3.9)
99
+ thor (0.18.1)
100
+ tilt (1.4.1)
101
+ treetop (1.4.15)
102
+ polyglot
103
+ polyglot (>= 0.3.1)
104
+ tzinfo (0.3.38)
18
105
 
19
106
  PLATFORMS
20
107
  ruby
21
108
 
22
109
  DEPENDENCIES
23
- bundler (~> 1.1)
24
- rake (>= 0.9.2)
110
+ appraisal
111
+ bundler
112
+ rails (~> 3)
113
+ rake
114
+ rspec-rails
25
115
  shoulda-kept-assign-to!
116
+ sqlite3
data/README.md CHANGED
@@ -27,10 +27,4 @@ group :test do
27
27
  gem "shoulda-kept-assign-to"
28
28
  end
29
29
 
30
- # `rspec-rails` needs to be in the development group so that Rails generators work.
31
- group :development, :test do
32
- gem "rspec-rails", "~> 2.12"
33
- end
34
- ```
35
-
36
30
  Shoulda will automatically include matchers into the appropriate example groups.
data/Rakefile CHANGED
@@ -1,2 +1,22 @@
1
1
  require 'bundler/setup'
2
2
  require 'bundler/gem_tasks'
3
+ require 'rspec/core/rake_task'
4
+ require 'appraisal'
5
+
6
+ RSpec::Core::RakeTask.new do |t|
7
+ t.pattern = "spec/**/*_spec.rb"
8
+ t.rspec_opts = '--color --format progress'
9
+ t.verbose = false
10
+ end
11
+
12
+ task :default do |t|
13
+ if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
14
+ exec 'rake spec'
15
+ else
16
+ Rake::Task['appraise'].execute
17
+ end
18
+ end
19
+
20
+ task :appraise => ['appraisal:install'] do |t|
21
+ exec 'rake appraisal'
22
+ end
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.0"
6
+
7
+ gemspec :path=>"../"
@@ -0,0 +1,120 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ shoulda-kept-assign-to (1.0.1)
5
+ shoulda-matchers (>= 2.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (3.2.17)
11
+ actionpack (= 3.2.17)
12
+ mail (~> 2.5.4)
13
+ actionpack (3.2.17)
14
+ activemodel (= 3.2.17)
15
+ activesupport (= 3.2.17)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.17)
24
+ activesupport (= 3.2.17)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.17)
27
+ activemodel (= 3.2.17)
28
+ activesupport (= 3.2.17)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.17)
32
+ activemodel (= 3.2.17)
33
+ activesupport (= 3.2.17)
34
+ activesupport (3.2.17)
35
+ i18n (~> 0.6, >= 0.6.4)
36
+ multi_json (~> 1.0)
37
+ appraisal (0.5.2)
38
+ bundler
39
+ rake
40
+ arel (3.0.3)
41
+ builder (3.0.4)
42
+ diff-lcs (1.2.5)
43
+ erubis (2.7.0)
44
+ hike (1.2.3)
45
+ i18n (0.6.9)
46
+ journey (1.0.4)
47
+ json (1.8.1)
48
+ mail (2.5.4)
49
+ mime-types (~> 1.16)
50
+ treetop (~> 1.4.8)
51
+ metaclass (0.0.4)
52
+ mime-types (1.25.1)
53
+ mocha (1.0.0)
54
+ metaclass (~> 0.0.1)
55
+ multi_json (1.9.0)
56
+ polyglot (0.3.4)
57
+ rack (1.4.5)
58
+ rack-cache (1.2)
59
+ rack (>= 0.4)
60
+ rack-ssl (1.3.3)
61
+ rack
62
+ rack-test (0.6.2)
63
+ rack (>= 1.0)
64
+ rails (3.2.17)
65
+ actionmailer (= 3.2.17)
66
+ actionpack (= 3.2.17)
67
+ activerecord (= 3.2.17)
68
+ activeresource (= 3.2.17)
69
+ activesupport (= 3.2.17)
70
+ bundler (~> 1.0)
71
+ railties (= 3.2.17)
72
+ railties (3.2.17)
73
+ actionpack (= 3.2.17)
74
+ activesupport (= 3.2.17)
75
+ rack-ssl (~> 1.3.2)
76
+ rake (>= 0.8.7)
77
+ rdoc (~> 3.4)
78
+ thor (>= 0.14.6, < 2.0)
79
+ rake (10.1.1)
80
+ rdoc (3.12.2)
81
+ json (~> 1.4)
82
+ rspec-core (2.14.8)
83
+ rspec-expectations (2.14.5)
84
+ diff-lcs (>= 1.1.3, < 2.0)
85
+ rspec-mocks (2.14.6)
86
+ rspec-rails (2.14.1)
87
+ actionpack (>= 3.0)
88
+ activemodel (>= 3.0)
89
+ activesupport (>= 3.0)
90
+ railties (>= 3.0)
91
+ rspec-core (~> 2.14.0)
92
+ rspec-expectations (~> 2.14.0)
93
+ rspec-mocks (~> 2.14.0)
94
+ shoulda-matchers (2.5.0)
95
+ activesupport (>= 3.0.0)
96
+ sprockets (2.2.2)
97
+ hike (~> 1.2)
98
+ multi_json (~> 1.0)
99
+ rack (~> 1.0)
100
+ tilt (~> 1.1, != 1.3.0)
101
+ sqlite3 (1.3.9)
102
+ thor (0.18.1)
103
+ tilt (1.4.1)
104
+ treetop (1.4.15)
105
+ polyglot
106
+ polyglot (>= 0.3.1)
107
+ tzinfo (0.3.38)
108
+
109
+ PLATFORMS
110
+ ruby
111
+
112
+ DEPENDENCIES
113
+ appraisal
114
+ bundler
115
+ mocha
116
+ rails (~> 3.0)
117
+ rake
118
+ rspec-rails
119
+ shoulda-kept-assign-to!
120
+ sqlite3
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.1"
6
+ gem "jquery-rails"
7
+ gem "sass-rails"
8
+
9
+ gemspec :path=>"../"
@@ -0,0 +1,130 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ shoulda-kept-assign-to (1.0.1)
5
+ shoulda-matchers (>= 2.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (3.2.17)
11
+ actionpack (= 3.2.17)
12
+ mail (~> 2.5.4)
13
+ actionpack (3.2.17)
14
+ activemodel (= 3.2.17)
15
+ activesupport (= 3.2.17)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.17)
24
+ activesupport (= 3.2.17)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.17)
27
+ activemodel (= 3.2.17)
28
+ activesupport (= 3.2.17)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.17)
32
+ activemodel (= 3.2.17)
33
+ activesupport (= 3.2.17)
34
+ activesupport (3.2.17)
35
+ i18n (~> 0.6, >= 0.6.4)
36
+ multi_json (~> 1.0)
37
+ appraisal (0.5.2)
38
+ bundler
39
+ rake
40
+ arel (3.0.3)
41
+ builder (3.0.4)
42
+ diff-lcs (1.2.5)
43
+ erubis (2.7.0)
44
+ hike (1.2.3)
45
+ i18n (0.6.9)
46
+ journey (1.0.4)
47
+ jquery-rails (3.1.0)
48
+ railties (>= 3.0, < 5.0)
49
+ thor (>= 0.14, < 2.0)
50
+ json (1.8.1)
51
+ mail (2.5.4)
52
+ mime-types (~> 1.16)
53
+ treetop (~> 1.4.8)
54
+ metaclass (0.0.4)
55
+ mime-types (1.25.1)
56
+ mocha (1.0.0)
57
+ metaclass (~> 0.0.1)
58
+ multi_json (1.9.0)
59
+ polyglot (0.3.4)
60
+ rack (1.4.5)
61
+ rack-cache (1.2)
62
+ rack (>= 0.4)
63
+ rack-ssl (1.3.3)
64
+ rack
65
+ rack-test (0.6.2)
66
+ rack (>= 1.0)
67
+ rails (3.2.17)
68
+ actionmailer (= 3.2.17)
69
+ actionpack (= 3.2.17)
70
+ activerecord (= 3.2.17)
71
+ activeresource (= 3.2.17)
72
+ activesupport (= 3.2.17)
73
+ bundler (~> 1.0)
74
+ railties (= 3.2.17)
75
+ railties (3.2.17)
76
+ actionpack (= 3.2.17)
77
+ activesupport (= 3.2.17)
78
+ rack-ssl (~> 1.3.2)
79
+ rake (>= 0.8.7)
80
+ rdoc (~> 3.4)
81
+ thor (>= 0.14.6, < 2.0)
82
+ rake (10.1.1)
83
+ rdoc (3.12.2)
84
+ json (~> 1.4)
85
+ rspec-core (2.14.8)
86
+ rspec-expectations (2.14.5)
87
+ diff-lcs (>= 1.1.3, < 2.0)
88
+ rspec-mocks (2.14.6)
89
+ rspec-rails (2.14.1)
90
+ actionpack (>= 3.0)
91
+ activemodel (>= 3.0)
92
+ activesupport (>= 3.0)
93
+ railties (>= 3.0)
94
+ rspec-core (~> 2.14.0)
95
+ rspec-expectations (~> 2.14.0)
96
+ rspec-mocks (~> 2.14.0)
97
+ sass (3.2.15)
98
+ sass-rails (3.2.6)
99
+ railties (~> 3.2.0)
100
+ sass (>= 3.1.10)
101
+ tilt (~> 1.3)
102
+ shoulda-matchers (2.5.0)
103
+ activesupport (>= 3.0.0)
104
+ sprockets (2.2.2)
105
+ hike (~> 1.2)
106
+ multi_json (~> 1.0)
107
+ rack (~> 1.0)
108
+ tilt (~> 1.1, != 1.3.0)
109
+ sqlite3 (1.3.9)
110
+ thor (0.18.1)
111
+ tilt (1.4.1)
112
+ treetop (1.4.15)
113
+ polyglot
114
+ polyglot (>= 0.3.1)
115
+ tzinfo (0.3.38)
116
+
117
+ PLATFORMS
118
+ ruby
119
+
120
+ DEPENDENCIES
121
+ appraisal
122
+ bundler
123
+ jquery-rails
124
+ mocha
125
+ rails (~> 3.1)
126
+ rake
127
+ rspec-rails
128
+ sass-rails
129
+ shoulda-kept-assign-to!
130
+ sqlite3
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 3.2"
6
+ gem "jquery-rails"
7
+ gem "sass-rails"
8
+
9
+ gemspec :path=>"../"
@@ -0,0 +1,130 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ shoulda-kept-assign-to (1.0.1)
5
+ shoulda-matchers (>= 2.1.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actionmailer (3.2.17)
11
+ actionpack (= 3.2.17)
12
+ mail (~> 2.5.4)
13
+ actionpack (3.2.17)
14
+ activemodel (= 3.2.17)
15
+ activesupport (= 3.2.17)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.5)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.2.1)
23
+ activemodel (3.2.17)
24
+ activesupport (= 3.2.17)
25
+ builder (~> 3.0.0)
26
+ activerecord (3.2.17)
27
+ activemodel (= 3.2.17)
28
+ activesupport (= 3.2.17)
29
+ arel (~> 3.0.2)
30
+ tzinfo (~> 0.3.29)
31
+ activeresource (3.2.17)
32
+ activemodel (= 3.2.17)
33
+ activesupport (= 3.2.17)
34
+ activesupport (3.2.17)
35
+ i18n (~> 0.6, >= 0.6.4)
36
+ multi_json (~> 1.0)
37
+ appraisal (0.5.2)
38
+ bundler
39
+ rake
40
+ arel (3.0.3)
41
+ builder (3.0.4)
42
+ diff-lcs (1.2.5)
43
+ erubis (2.7.0)
44
+ hike (1.2.3)
45
+ i18n (0.6.9)
46
+ journey (1.0.4)
47
+ jquery-rails (3.1.0)
48
+ railties (>= 3.0, < 5.0)
49
+ thor (>= 0.14, < 2.0)
50
+ json (1.8.1)
51
+ mail (2.5.4)
52
+ mime-types (~> 1.16)
53
+ treetop (~> 1.4.8)
54
+ metaclass (0.0.4)
55
+ mime-types (1.25.1)
56
+ mocha (1.0.0)
57
+ metaclass (~> 0.0.1)
58
+ multi_json (1.9.0)
59
+ polyglot (0.3.4)
60
+ rack (1.4.5)
61
+ rack-cache (1.2)
62
+ rack (>= 0.4)
63
+ rack-ssl (1.3.3)
64
+ rack
65
+ rack-test (0.6.2)
66
+ rack (>= 1.0)
67
+ rails (3.2.17)
68
+ actionmailer (= 3.2.17)
69
+ actionpack (= 3.2.17)
70
+ activerecord (= 3.2.17)
71
+ activeresource (= 3.2.17)
72
+ activesupport (= 3.2.17)
73
+ bundler (~> 1.0)
74
+ railties (= 3.2.17)
75
+ railties (3.2.17)
76
+ actionpack (= 3.2.17)
77
+ activesupport (= 3.2.17)
78
+ rack-ssl (~> 1.3.2)
79
+ rake (>= 0.8.7)
80
+ rdoc (~> 3.4)
81
+ thor (>= 0.14.6, < 2.0)
82
+ rake (10.1.1)
83
+ rdoc (3.12.2)
84
+ json (~> 1.4)
85
+ rspec-core (2.14.8)
86
+ rspec-expectations (2.14.5)
87
+ diff-lcs (>= 1.1.3, < 2.0)
88
+ rspec-mocks (2.14.6)
89
+ rspec-rails (2.14.1)
90
+ actionpack (>= 3.0)
91
+ activemodel (>= 3.0)
92
+ activesupport (>= 3.0)
93
+ railties (>= 3.0)
94
+ rspec-core (~> 2.14.0)
95
+ rspec-expectations (~> 2.14.0)
96
+ rspec-mocks (~> 2.14.0)
97
+ sass (3.2.15)
98
+ sass-rails (3.2.6)
99
+ railties (~> 3.2.0)
100
+ sass (>= 3.1.10)
101
+ tilt (~> 1.3)
102
+ shoulda-matchers (2.5.0)
103
+ activesupport (>= 3.0.0)
104
+ sprockets (2.2.2)
105
+ hike (~> 1.2)
106
+ multi_json (~> 1.0)
107
+ rack (~> 1.0)
108
+ tilt (~> 1.1, != 1.3.0)
109
+ sqlite3 (1.3.9)
110
+ thor (0.18.1)
111
+ tilt (1.4.1)
112
+ treetop (1.4.15)
113
+ polyglot
114
+ polyglot (>= 0.3.1)
115
+ tzinfo (0.3.38)
116
+
117
+ PLATFORMS
118
+ ruby
119
+
120
+ DEPENDENCIES
121
+ appraisal
122
+ bundler
123
+ jquery-rails
124
+ mocha
125
+ rails (~> 3.2)
126
+ rake
127
+ rspec-rails
128
+ sass-rails
129
+ shoulda-kept-assign-to!
130
+ sqlite3
@@ -1,9 +1,8 @@
1
1
  $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
2
- require 'shoulda/matchers/version'
3
2
 
4
3
  Gem::Specification.new do |s|
5
4
  s.name = "shoulda-kept-assign-to"
6
- s.version = Shoulda::Matchers::VERSION.dup
5
+ s.version = '1.0.1'
7
6
  s.authors = ["Angel Irizarry", "Ben Sedat"]
8
7
  s.date = Time.now.strftime("%Y-%m-%d")
9
8
  s.email = "engineers@tinfoilsecurity.com"
@@ -20,6 +19,10 @@ Gem::Specification.new do |s|
20
19
  s.required_ruby_version = '>= 1.9.2'
21
20
  s.add_dependency('shoulda-matchers', '>= 2.1.0')
22
21
 
23
- s.add_development_dependency('bundler', '~> 1.1')
24
- s.add_development_dependency('rake', '>= 0.9.2')
22
+ s.add_development_dependency('bundler')
23
+ s.add_development_dependency('rake')
24
+ s.add_development_dependency('appraisal')
25
+ s.add_development_dependency('rails', '~> 3')
26
+ s.add_development_dependency('sqlite3')
27
+ s.add_development_dependency('rspec-rails')
25
28
  end
@@ -0,0 +1,66 @@
1
+ require 'spec_helper'
2
+
3
+ describe Shoulda::Matchers::ActionController::AssignToMatcher do
4
+ it 'includes the actual class in the failure message' do
5
+ define_class(:WrongClass) do
6
+ def to_s
7
+ 'wrong class'
8
+ end
9
+ end
10
+
11
+ controller = build_response { @var = WrongClass.new }
12
+ matcher = assign_to(:var).with_kind_of(Fixnum)
13
+ matcher.matches?(controller)
14
+
15
+ matcher.failure_message_for_should.should =~ /kind of Fixnum for var, but got.*\(WrongClass\)$/
16
+ end
17
+
18
+ context 'a controller that assigns to an instance variable' do
19
+ it 'accepts assigning to that variable' do
20
+ controller.should assign_to(:var)
21
+ end
22
+
23
+ it 'accepts assigning to that variable with the correct class' do
24
+ controller.should assign_to(:var).with_kind_of(String)
25
+ end
26
+
27
+ it 'rejects assigning to that variable with another class' do
28
+ controller.should_not assign_to(:var).with_kind_of(Fixnum)
29
+ end
30
+
31
+ it 'accepts assigning the correct value to that variable' do
32
+ controller.should assign_to(:var).with('value')
33
+ end
34
+
35
+ it 'rejects assigning another value to that variable' do
36
+ controller.should_not assign_to(:var).with('other')
37
+ end
38
+
39
+ it 'rejects assigning to another variable' do
40
+ controller.should_not assign_to(:other)
41
+ end
42
+
43
+ it 'accepts assigning to the same value in the test context' do
44
+ expected = 'value'
45
+ controller.should assign_to(:var).in_context(self).with { expected }
46
+ end
47
+
48
+ it 'rejects assigning to the another value in the test context' do
49
+ expected = 'other'
50
+ controller.should_not assign_to(:var).in_context(self).with { expected }
51
+ end
52
+
53
+ def controller
54
+ build_response { @var = 'value' }
55
+ end
56
+ end
57
+
58
+ context 'a controller that assigns a nil value to an instance variable' do
59
+ it 'accepts assigning to that variable' do
60
+ controller = build_response do
61
+ @var = nil
62
+ end
63
+ controller.should assign_to(:var)
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,26 @@
1
+ # Create Rails environment based on the version given from Appraisal
2
+ TESTAPP_ROOT = File.join(File.dirname(__FILE__), '..', 'tmp', 'testapp')
3
+ FileUtils.rm_rf(TESTAPP_ROOT) if File.exists?(TESTAPP_ROOT)
4
+ `rails new #{TESTAPP_ROOT}`
5
+
6
+ ENV['RAILS_ENV'] = 'test'
7
+ ENV['BUNDLE_GEMFILE'] ||= TESTAPP_ROOT + '/Gemfile'
8
+
9
+ require "#{TESTAPP_ROOT}/config/environment"
10
+ require 'shoulda-matchers'
11
+ require 'rspec/rails'
12
+
13
+ PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')).freeze
14
+
15
+ $LOAD_PATH << File.join(PROJECT_ROOT, 'lib')
16
+
17
+ Dir[File.join(PROJECT_ROOT, 'spec', 'support', '**', '*.rb')].each { |file| require(file) }
18
+
19
+ # Run the migrations
20
+ ActiveRecord::Migration.verbose = false
21
+ ActiveRecord::Migrator.migrate(Rails.root.join('db/migrate'))
22
+
23
+ RSpec.configure do |config|
24
+ config.include Shoulda::Matchers::ActionController,
25
+ :example_group => { :file_path => /action_controller/ }
26
+ end
@@ -0,0 +1,42 @@
1
+ module ClassBuilder
2
+ def self.included(example_group)
3
+ example_group.class_eval do
4
+ after do
5
+ teardown_defined_constants
6
+ end
7
+ end
8
+ end
9
+
10
+ def define_class(class_name, base = Object, &block)
11
+ class_name = class_name.to_s.camelize
12
+
13
+ # FIXME: ActionMailer 3.2 calls `name.underscore` immediately upon
14
+ # subclassing. Class.new.name == nil. So, Class.new(ActionMailer::Base)
15
+ # errors out since it's trying to do `nil.underscore`. This is very ugly but
16
+ # allows us to test against ActionMailer 3.2.x.
17
+ eval <<-A_REAL_CLASS_FOR_ACTION_MAILER_3_2
18
+ class ::#{class_name} < #{base}
19
+ end
20
+ A_REAL_CLASS_FOR_ACTION_MAILER_3_2
21
+
22
+ Object.const_get(class_name).tap do |constant_class|
23
+ constant_class.unloadable
24
+
25
+ if block_given?
26
+ constant_class.class_eval(&block)
27
+ end
28
+
29
+ if constant_class.respond_to?(:reset_column_information)
30
+ constant_class.reset_column_information
31
+ end
32
+ end
33
+ end
34
+
35
+ def teardown_defined_constants
36
+ ActiveSupport::Dependencies.clear
37
+ end
38
+ end
39
+
40
+ RSpec.configure do |config|
41
+ config.include ClassBuilder
42
+ end
@@ -0,0 +1,104 @@
1
+ module ControllerBuilder
2
+ TMP_VIEW_PATH = File.expand_path(File.join(TESTAPP_ROOT, 'tmp',
3
+ 'views')).freeze
4
+
5
+ def self.included(example_group)
6
+ example_group.class_eval do
7
+ after do
8
+ delete_temporary_views
9
+ restore_original_routes
10
+ end
11
+ end
12
+ end
13
+
14
+ def define_controller(class_name, &block)
15
+ class_name = class_name.to_s
16
+ class_name << 'Controller' unless class_name =~ /Controller$/
17
+ define_class(class_name, ActionController::Base, &block)
18
+ end
19
+
20
+ def define_routes(&block)
21
+ Rails.application.routes.draw(&block)
22
+ @routes = Rails.application.routes
23
+ class << self
24
+ include ActionDispatch::Assertions
25
+ end
26
+ end
27
+
28
+ def build_response(opts = {}, &block)
29
+ action = opts[:action] || 'example'
30
+ partial = opts[:partial] || '_partial'
31
+ block ||= lambda { render :nothing => true }
32
+ controller_class = define_controller('Examples') do
33
+ layout false
34
+ define_method(action, &block)
35
+ end
36
+ controller_class.view_paths = [TMP_VIEW_PATH]
37
+
38
+ define_routes do
39
+ get 'examples', :to => "examples##{action}"
40
+ end
41
+
42
+ create_view("examples/#{action}.html.erb", 'action')
43
+ create_view("examples/#{partial}.html.erb", 'partial')
44
+
45
+ setup_rails_controller_test(controller_class)
46
+ get action
47
+
48
+ @controller
49
+ end
50
+
51
+ def setup_rails_controller_test(controller_class)
52
+ @controller = controller_class.new
53
+ @request = ::ActionController::TestRequest.new
54
+ @response = ::ActionController::TestResponse.new
55
+
56
+ class << self
57
+ include ActionController::TestCase::Behavior
58
+ end
59
+ end
60
+
61
+ def create_view(path, contents)
62
+ full_path = File.join(TMP_VIEW_PATH, path)
63
+ FileUtils.mkdir_p(File.dirname(full_path))
64
+ File.open(full_path, 'w') { |file| file.write(contents) }
65
+ end
66
+
67
+ def controller_for_resource_with_strong_parameters(&block)
68
+ define_model "User"
69
+ controller_class = define_controller "Users" do
70
+ def new
71
+ @user = User.new
72
+ render :nothing => true
73
+ end
74
+
75
+ def create
76
+ @user = User.create(user_params)
77
+ render :nothing => true
78
+ end
79
+
80
+ private
81
+ define_method :user_params, &block
82
+ end
83
+
84
+ setup_rails_controller_test(controller_class)
85
+
86
+ define_routes { resources :users }
87
+
88
+ controller_class
89
+ end
90
+
91
+ private
92
+
93
+ def delete_temporary_views
94
+ FileUtils.rm_rf(TMP_VIEW_PATH)
95
+ end
96
+
97
+ def restore_original_routes
98
+ Rails.application.reload_routes!
99
+ end
100
+ end
101
+
102
+ RSpec.configure do |config|
103
+ config.include ControllerBuilder
104
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoulda-kept-assign-to
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
  - Angel Irizarry
@@ -9,50 +9,106 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-25 00:00:00.000000000 Z
12
+ date: 2014-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda-matchers
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: 2.1.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 2.1.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: appraisal
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: rails
30
72
  requirement: !ruby/object:Gem::Requirement
31
73
  requirements:
32
74
  - - ~>
33
75
  - !ruby/object:Gem::Version
34
- version: '1.1'
76
+ version: '3'
35
77
  type: :development
36
78
  prerelease: false
37
79
  version_requirements: !ruby/object:Gem::Requirement
38
80
  requirements:
39
81
  - - ~>
40
82
  - !ruby/object:Gem::Version
41
- version: '1.1'
83
+ version: '3'
42
84
  - !ruby/object:Gem::Dependency
43
- name: rake
85
+ name: sqlite3
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: rspec-rails
44
100
  requirement: !ruby/object:Gem::Requirement
45
101
  requirements:
46
- - - ! '>='
102
+ - - '>='
47
103
  - !ruby/object:Gem::Version
48
- version: 0.9.2
104
+ version: '0'
49
105
  type: :development
50
106
  prerelease: false
51
107
  version_requirements: !ruby/object:Gem::Requirement
52
108
  requirements:
53
- - - ! '>='
109
+ - - '>='
54
110
  - !ruby/object:Gem::Version
55
- version: 0.9.2
111
+ version: '0'
56
112
  description: We miss the assign_to matcher in shoulda-matchers.
57
113
  email: engineers@tinfoilsecurity.com
58
114
  executables: []
@@ -60,16 +116,26 @@ extensions: []
60
116
  extra_rdoc_files: []
61
117
  files:
62
118
  - .gitignore
119
+ - Appraisals
63
120
  - CONTRIBUTING.md
64
121
  - Gemfile
65
122
  - Gemfile.lock
66
123
  - MIT-LICENSE
67
124
  - README.md
68
125
  - Rakefile
126
+ - gemfiles/3.0.gemfile
127
+ - gemfiles/3.0.gemfile.lock
128
+ - gemfiles/3.1.gemfile
129
+ - gemfiles/3.1.gemfile.lock
130
+ - gemfiles/3.2.gemfile
131
+ - gemfiles/3.2.gemfile.lock
69
132
  - lib/shoulda-kept-assign-to.rb
70
133
  - lib/shoulda/matchers/action_controller/assign_to_matcher.rb
71
- - lib/shoulda/matchers/version.rb
72
134
  - shoulda-kept-assign-to.gemspec
135
+ - spec/shoulda/matchers/action_controller/assign_to_matcher_spec.rb
136
+ - spec/spec_helper.rb
137
+ - spec/support/class_builder.rb
138
+ - spec/support/controller_builder.rb
73
139
  homepage: https://www.tinfoilsecurity.com
74
140
  licenses:
75
141
  - MIT
@@ -80,18 +146,22 @@ require_paths:
80
146
  - lib
81
147
  required_ruby_version: !ruby/object:Gem::Requirement
82
148
  requirements:
83
- - - ! '>='
149
+ - - '>='
84
150
  - !ruby/object:Gem::Version
85
151
  version: 1.9.2
86
152
  required_rubygems_version: !ruby/object:Gem::Requirement
87
153
  requirements:
88
- - - ! '>='
154
+ - - '>='
89
155
  - !ruby/object:Gem::Version
90
156
  version: '0'
91
157
  requirements: []
92
158
  rubyforge_project:
93
- rubygems_version: 2.0.3
159
+ rubygems_version: 2.2.2
94
160
  signing_key:
95
161
  specification_version: 4
96
162
  summary: We miss the assign_to matcher in shoulda-matchers.
97
- test_files: []
163
+ test_files:
164
+ - spec/shoulda/matchers/action_controller/assign_to_matcher_spec.rb
165
+ - spec/spec_helper.rb
166
+ - spec/support/class_builder.rb
167
+ - spec/support/controller_builder.rb
@@ -1,5 +0,0 @@
1
- module Shoulda
2
- module Matchers
3
- VERSION = '1.0.0'.freeze
4
- end
5
- end