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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e864aeb69e77e8f460e0f460c7754a68a48e9e2
4
- data.tar.gz: 6ae4108cc1ee02ebde9241cf199f9dc2289fbba3
3
+ metadata.gz: 7d3cbe42d72c791c18fd3a271293336c88f32e33
4
+ data.tar.gz: b11fb798a21ae74e974013669bdd3fc7de356457
5
5
  SHA512:
6
- metadata.gz: 8316fc9f814276932f43635cf90841ad98a064eb71f1dd03962646757b4308caa2c54850dba8389a9c484add492b3e594b56de2ee0fb7d917843935dbed04ec1
7
- data.tar.gz: f73460bb71b1d803423467704f57582408b89799c1e3add6ebf27cda546b73ecae54ecf44047de58634b52c5af6f460172810f0d32fcf390c2aabfda55176e12
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.2"
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 providees a minimal interface for using fixuture.
10
- Also see http://borot.github.com/.
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.rdoc)
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
@@ -17,8 +17,8 @@ class Fixit
17
17
  alias method_missing attribute
18
18
 
19
19
  class << self
20
- FIXIT_FILE = 'fixits.rb'
21
- FIXIT_DIR = 'fixit'
20
+ FIXIT_FILE = 'spec/fixits.rb'
21
+ FIXIT_DIR = 'spec/fixit'
22
22
 
23
23
  @@prepared = false
24
24
 
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.2
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 providees a minimal interface for using fixuture.
15
- Also see http://borot.github.com/.
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.rdoc
25
+ - README.md
26
26
  homepage: http://borot.github.com/
27
27
  licenses:
28
28
  - MIT
data/README.rdoc DELETED
@@ -1,13 +0,0 @@
1
- = INSTALL
2
-
3
- gem install fixit
4
-
5
- = Usage
6
-
7
- = DESCRIPTION
8
-
9
- simple fixture
10
-
11
- = Further Reading
12
-
13
- https://github.com/borot/fixit