rspec_more 0.3.1 → 0.3.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.3.1.1 changed the errors being queried also uniqueness_on matcher
1
2
  v0.3.1 added uniqueness_on matcher
2
3
  v0.3 take subject as the object if there is one
3
4
  v0.2 a brutal support for active record
@@ -6,7 +6,16 @@ module RspecMore
6
6
  object = subject || send(object_name)
7
7
  object.send("#{field}=", nil)
8
8
  object.should_not be_valid
9
- object.errors.should have_key(field.to_sym)
9
+ subject.errors[field.to_sym].should_not be_nil
10
+ end
11
+ end
12
+ def uniqueness_on(field)
13
+ it "requires #{field} to be unique" do
14
+ subject.save!
15
+ object_name = self.send(:described_class).to_s.demodulize.underscore.to_sym
16
+ another = self.send(:described_class).make object_name, field => subject.send(field)
17
+ another.should_not be_valid
18
+ subject.errors[field.to_sym].should_not be_nil
10
19
  end
11
20
  end
12
21
  end
data/rspec_more.gemspec CHANGED
@@ -2,20 +2,20 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rspec_more}
5
- s.version = "0.3.1"
5
+ s.version = "0.3.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = [%q{Yi Wen}]
9
- s.date = %q{2011-06-24}
8
+ s.authors = ["Yi Wen"]
9
+ s.date = %q{2011-07-06}
10
10
  s.description = %q{A Rspec extension for more macros and matchers, etc.}
11
11
  s.email = %q{hayafirst@gmail.com}
12
- s.extra_rdoc_files = [%q{CHANGELOG}, %q{README.md}, %q{lib/rspec_more.rb}, %q{lib/rspec_more/active_record.rb}, %q{lib/rspec_more/data_mapper.rb}]
13
- s.files = [%q{CHANGELOG}, %q{Gemfile}, %q{Gemfile.lock}, %q{Manifest}, %q{README.md}, %q{Rakefile}, %q{lib/rspec_more.rb}, %q{lib/rspec_more/active_record.rb}, %q{lib/rspec_more/data_mapper.rb}, %q{rspec_more.gemspec}]
12
+ s.extra_rdoc_files = ["CHANGELOG", "README.md", "lib/rspec_more.rb", "lib/rspec_more/active_record.rb", "lib/rspec_more/data_mapper.rb"]
13
+ s.files = ["CHANGELOG", "Gemfile", "Gemfile.lock", "Manifest", "README.md", "Rakefile", "lib/rspec_more.rb", "lib/rspec_more/active_record.rb", "lib/rspec_more/data_mapper.rb", "rspec_more.gemspec"]
14
14
  s.homepage = %q{https://github.com/ywen/rspec_more}
15
- s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Rspec_more}, %q{--main}, %q{README.md}]
16
- s.require_paths = [%q{lib}]
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rspec_more", "--main", "README.md"]
16
+ s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{rspec_more}
18
- s.rubygems_version = %q{1.8.5}
18
+ s.rubygems_version = %q{1.4.0}
19
19
  s.summary = %q{A Rspec extension for more macros and matchers, etc.}
20
20
 
21
21
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,27 +1,38 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rspec_more
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 81
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 1
10
+ - 1
11
+ version: 0.3.1.1
6
12
  platform: ruby
7
- authors:
13
+ authors:
8
14
  - Yi Wen
9
15
  autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
- date: 2011-06-24 00:00:00.000000000Z
18
+
19
+ date: 2011-07-06 00:00:00 -05:00
20
+ default_executable:
13
21
  dependencies: []
22
+
14
23
  description: A Rspec extension for more macros and matchers, etc.
15
24
  email: hayafirst@gmail.com
16
25
  executables: []
26
+
17
27
  extensions: []
18
- extra_rdoc_files:
28
+
29
+ extra_rdoc_files:
19
30
  - CHANGELOG
20
31
  - README.md
21
32
  - lib/rspec_more.rb
22
33
  - lib/rspec_more/active_record.rb
23
34
  - lib/rspec_more/data_mapper.rb
24
- files:
35
+ files:
25
36
  - CHANGELOG
26
37
  - Gemfile
27
38
  - Gemfile.lock
@@ -32,34 +43,45 @@ files:
32
43
  - lib/rspec_more/active_record.rb
33
44
  - lib/rspec_more/data_mapper.rb
34
45
  - rspec_more.gemspec
46
+ has_rdoc: true
35
47
  homepage: https://github.com/ywen/rspec_more
36
48
  licenses: []
49
+
37
50
  post_install_message:
38
- rdoc_options:
51
+ rdoc_options:
39
52
  - --line-numbers
40
53
  - --inline-source
41
54
  - --title
42
55
  - Rspec_more
43
56
  - --main
44
57
  - README.md
45
- require_paths:
58
+ require_paths:
46
59
  - lib
47
- required_ruby_version: !ruby/object:Gem::Requirement
60
+ required_ruby_version: !ruby/object:Gem::Requirement
48
61
  none: false
49
- requirements:
50
- - - ! '>='
51
- - !ruby/object:Gem::Version
52
- version: '0'
53
- required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
70
  none: false
55
- requirements:
56
- - - ! '>='
57
- - !ruby/object:Gem::Version
58
- version: '1.2'
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 11
75
+ segments:
76
+ - 1
77
+ - 2
78
+ version: "1.2"
59
79
  requirements: []
80
+
60
81
  rubyforge_project: rspec_more
61
- rubygems_version: 1.8.5
82
+ rubygems_version: 1.4.0
62
83
  signing_key:
63
84
  specification_version: 3
64
85
  summary: A Rspec extension for more macros and matchers, etc.
65
86
  test_files: []
87
+