assertalot 0.1.0
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 +4 -0
- data/.lm_version +1 -0
- data/Gemfile +4 -0
- data/Rakefile +2 -0
- data/assertalot.gemspec +22 -0
- data/lib/assertalot/assertions.rb +19 -0
- data/lib/assertalot/version.rb +3 -0
- data/lib/assertalot.rb +3 -0
- metadata +64 -0
data/.gitignore
ADDED
data/.lm_version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/Gemfile
ADDED
data/Rakefile
ADDED
data/assertalot.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
|
4
|
+
require 'assertalot/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "assertalot"
|
8
|
+
s.version = Assertalot::VERSION
|
9
|
+
s.platform = Gem::Platform::RUBY
|
10
|
+
s.authors = ["Sam Taylor"]
|
11
|
+
s.email = ["sjltaylor@gmail.com"]
|
12
|
+
s.homepage = ""
|
13
|
+
s.summary = %q{Some helpful assert statements}
|
14
|
+
s.description = %q{Auxiliary asserttions for RTest tests}
|
15
|
+
|
16
|
+
s.rubyforge_project = "assertalot"
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
|
+
s.require_paths = ["lib"]
|
22
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Assertalot
|
2
|
+
module Assertions
|
3
|
+
def assert_not_blank thing, message="must not be blank"
|
4
|
+
assert !thing.blank?, message
|
5
|
+
end
|
6
|
+
|
7
|
+
def assert_valid_version str
|
8
|
+
assert_match /^\d+\.\d+\.\d+$/, str, "The version must be in the form MAJOR.MINOR.PATCH"
|
9
|
+
end
|
10
|
+
|
11
|
+
def assert_error_on(model, field)
|
12
|
+
assert !model.errors[field.to_sym].blank?, "No validation error on the #{field.to_s} field."
|
13
|
+
end
|
14
|
+
|
15
|
+
def assert_no_error_on(model, field)
|
16
|
+
assert model.errors[field.to_sym].blank?, "Validation error on #{field.to_s}."
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/assertalot.rb
ADDED
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: assertalot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Sam Taylor
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-04-11 00:00:00 +01:00
|
14
|
+
default_executable:
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description: Auxiliary asserttions for RTest tests
|
18
|
+
email:
|
19
|
+
- sjltaylor@gmail.com
|
20
|
+
executables: []
|
21
|
+
|
22
|
+
extensions: []
|
23
|
+
|
24
|
+
extra_rdoc_files: []
|
25
|
+
|
26
|
+
files:
|
27
|
+
- .gitignore
|
28
|
+
- .lm_version
|
29
|
+
- Gemfile
|
30
|
+
- Rakefile
|
31
|
+
- assertalot.gemspec
|
32
|
+
- lib/assertalot.rb
|
33
|
+
- lib/assertalot/assertions.rb
|
34
|
+
- lib/assertalot/version.rb
|
35
|
+
has_rdoc: true
|
36
|
+
homepage: ""
|
37
|
+
licenses: []
|
38
|
+
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: "0"
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "0"
|
56
|
+
requirements: []
|
57
|
+
|
58
|
+
rubyforge_project: assertalot
|
59
|
+
rubygems_version: 1.5.0
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Some helpful assert statements
|
63
|
+
test_files: []
|
64
|
+
|