fixit 0.0.2 → 0.0.4
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.
- checksums.yaml +4 -4
- data/README.md +73 -0
- data/fixit.gemspec +4 -4
- data/lib/fixit/fixit.rb +2 -2
- metadata +4 -4
- data/README.rdoc +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d3cbe42d72c791c18fd3a271293336c88f32e33
|
|
4
|
+
data.tar.gz: b11fb798a21ae74e974013669bdd3fc7de356457
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cdfa01542bee77f26f1fdc7cc9ed7091a2c38b3e13a5d01f1e879467f7d82bfee61654e763211c54f4a44c7c7eb0f68eb03e4468e2b7ac7cea8823292c543561
|
|
7
|
+
data.tar.gz: 946ccb1bce3f8775e2e08c8bd40a6f07d03fca56d74027391e29ec2cf17e8e60cb3e41cac65269b6573b3687c6340160072f20f88d56f0d0277c3b5110aaeba9
|
data/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Fixit, a simple fixture for rspec
|
|
2
|
+
|
|
3
|
+
## What is it?
|
|
4
|
+
|
|
5
|
+
####It
|
|
6
|
+
|
|
7
|
+
* is a very simple and lightweight fixture easy to use
|
|
8
|
+
* can be used under various situations
|
|
9
|
+
* requires no other libraries
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
gem install fixit
|
|
14
|
+
|
|
15
|
+
## How to use
|
|
16
|
+
####write fixture
|
|
17
|
+
|
|
18
|
+
in \#spec/fixits.rb
|
|
19
|
+
|
|
20
|
+
Fixit.manage User do
|
|
21
|
+
assign :user1 do
|
|
22
|
+
name 'Taro Yamada'
|
|
23
|
+
email { #this is a block }
|
|
24
|
+
created_at Time.now
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
assign :user2 do
|
|
28
|
+
name { Faker::Name.name + 's' }
|
|
29
|
+
email Faker::Internet.email
|
|
30
|
+
deleted true
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
Fixit.manage Post do
|
|
35
|
+
assign :post1 do
|
|
36
|
+
title 'title1'
|
|
37
|
+
body '....'
|
|
38
|
+
user_id { Fixit.get(:user1).id }
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
or you can put separated files in spec/fixit/* . Files are automatically loaded.
|
|
43
|
+
|
|
44
|
+
####load fixture
|
|
45
|
+
|
|
46
|
+
\#spec/spec_helper.rb
|
|
47
|
+
|
|
48
|
+
require 'fixit'
|
|
49
|
+
Fixit.load
|
|
50
|
+
|
|
51
|
+
if you don't want to insert records but use model's instances,
|
|
52
|
+
|
|
53
|
+
Fixit.prepare
|
|
54
|
+
|
|
55
|
+
instead of Fixit.load.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
####use fixture
|
|
59
|
+
|
|
60
|
+
\#spec/models/user_spec.rb
|
|
61
|
+
|
|
62
|
+
describe User do
|
|
63
|
+
let (:user) { Fixit.get(:user2) }
|
|
64
|
+
.....
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
##Assumption
|
|
68
|
+
|
|
69
|
+
Fixit assumes that model classes
|
|
70
|
+
|
|
71
|
+
* have accessor methods to each attributes(i.e; columns of record)
|
|
72
|
+
* have save! method to insert new record
|
|
73
|
+
|
data/fixit.gemspec
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = "fixit"
|
|
3
|
-
s.version = "0.0.
|
|
3
|
+
s.version = "0.0.4"
|
|
4
4
|
s.platform = Gem::Platform::RUBY
|
|
5
5
|
s.summary = "simple fixture for rspec"
|
|
6
6
|
s.license = "MIT"
|
|
7
7
|
|
|
8
8
|
s.description = <<-EOF
|
|
9
|
-
Fixit
|
|
10
|
-
Also see
|
|
9
|
+
Fixit provides a minimal interface for using fixuture.
|
|
10
|
+
Also see https://github.com/borot .
|
|
11
11
|
EOF
|
|
12
12
|
|
|
13
13
|
s.files = Dir['{lib/**/*}'] +
|
|
14
|
-
%w(fixit.gemspec Rakefile README.
|
|
14
|
+
%w(fixit.gemspec Rakefile README.md)
|
|
15
15
|
s.require_path = 'lib'
|
|
16
16
|
|
|
17
17
|
s.author = 'Masato Ishimoto'
|
data/lib/fixit/fixit.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fixit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Masato Ishimoto
|
|
@@ -11,8 +11,8 @@ cert_chain: []
|
|
|
11
11
|
date: 2013-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: |
|
|
14
|
-
Fixit
|
|
15
|
-
Also see
|
|
14
|
+
Fixit provides a minimal interface for using fixuture.
|
|
15
|
+
Also see https://github.com/borot .
|
|
16
16
|
email: masato.ishimoto@gmail.com
|
|
17
17
|
executables: []
|
|
18
18
|
extensions: []
|
|
@@ -22,7 +22,7 @@ files:
|
|
|
22
22
|
- lib/fixit.rb
|
|
23
23
|
- fixit.gemspec
|
|
24
24
|
- Rakefile
|
|
25
|
-
- README.
|
|
25
|
+
- README.md
|
|
26
26
|
homepage: http://borot.github.com/
|
|
27
27
|
licenses:
|
|
28
28
|
- MIT
|