fixit 0.0.5 → 0.0.6

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -6
  3. data/fixit.gemspec +1 -1
  4. data/lib/fixit/fixit.rb +6 -4
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06f9d580976dc6995a835703f5e3a21e5b1a3e02
4
- data.tar.gz: 11cfd7a6bb178cbb8379e614a15a06208aff5621
3
+ metadata.gz: eabf965490df944ffd5aed4c419c87d486e87a0c
4
+ data.tar.gz: 5a336c8185c2bcaf907d152e6640bee0b493ee42
5
5
  SHA512:
6
- metadata.gz: 560703e0ca510f0687609b413252227365450b9dd12d7803b5d56a0454b84eeb9edfbd40640d4d7a0592e7cb46d13e2b9a488ac04d07f9d6cf2a62fc526eecd6
7
- data.tar.gz: 9e895dc0d93e74929b192d8f4a7e93cf655dd7391aeb81e1cd2d3c532665e27957b4059dd8a0cf5ff10834b2a584dcbef8367dd24a0d4c263ed54a4bfbe13d6e
6
+ metadata.gz: 295a817c215f110cf1c675cdcc61a0d4fdb6ba371ac17ac3a19ae202c3f955881e8340f85532d711b84eabbf8b7dc8936d1241398c79da3a2cfb0aad5332b463
7
+ data.tar.gz: 8fd55c5a5f043853e9c0f3c8aac024c653a09e67c209dc52d1b33eb4e532861d0be03f79a2895aaf7399b971546d8675bf64ab2eee5facabf447cabf77a50acb
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Fixit, a simple fixture for rspec
1
+ # Fixit, a simple fixture for rspec and may be others
2
2
 
3
3
  ## What is it?
4
4
 
@@ -15,7 +15,7 @@
15
15
  ## How to use
16
16
  ####write fixture
17
17
 
18
- in \#spec/fixits.rb
18
+ #spec/fixits.rb
19
19
 
20
20
  Fixit.manage User do
21
21
  assign :user1 do
@@ -39,12 +39,32 @@ in \#spec/fixits.rb
39
39
  end
40
40
  end
41
41
 
42
- or you can put separated files in spec/fixit/* . Files are automatically loaded.
42
+ Of cource, you can add many records at once by like this.
43
+
44
+ Fixit.manage User do
45
+ 1000.times do |i|
46
+ assign "user#{i+1}".to_sym do
47
+ name Faker::Name.name
48
+ email Faker::Internet.email
49
+ end
50
+ end
51
+ end
52
+
53
+ And you can put it as separate files in other directory.
54
+
55
+ Fixit automatically loads
56
+
57
+ * spec/fixits.rb
58
+ * spec/fixit/*.rb
59
+ * test/fixits.rb
60
+ * test/fixit/*.rb
61
+
62
+
63
+
43
64
 
44
65
  ####load fixture
45
66
 
46
- \#spec/spec_helper.rb
47
-
67
+ #spec/spec_helper.rb
48
68
  require 'fixit'
49
69
  Fixit.load
50
70
 
@@ -69,5 +89,5 @@ instead of Fixit.load.
69
89
  Fixit assumes that model classes
70
90
 
71
91
  * have accessor methods to each attributes(i.e; columns of record)
72
- * have save! method to insert new record
92
+ * have save! or save method to insert new record
73
93
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "fixit"
3
- s.version = "0.0.5"
3
+ s.version = "0.0.6"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.summary = "simple fixture for rspec"
6
6
  s.license = "MIT"
@@ -17,8 +17,8 @@ class Fixit
17
17
  alias method_missing attribute
18
18
 
19
19
  class << self
20
- FIXIT_FILE = 'spec/fixits.rb'
21
- FIXIT_DIR = 'spec/fixit'
20
+ FIXIT_FILE = 'fixits.rb'
21
+ FIXIT_DIR = 'fixit'
22
22
 
23
23
  @@prepared = false
24
24
 
@@ -57,8 +57,10 @@ class Fixit
57
57
  end
58
58
 
59
59
  def prepare
60
- require FIXIT_FILE if File.exists? FIXIT_FILE
61
- Dir["#{FIXIT_DIR}/*.rb"].each {|f| require f }
60
+ %w(spec test).each do |dir|
61
+ require "#{dir}/#{FIXIT_FILE}" if File.exists? "#{dir}/#{FIXIT_FILE}"
62
+ Dir["#{dir}/#{FIXIT_DIR}/*.rb"].each {|f| require f }
63
+ end
62
64
  @@prepared = true
63
65
  end
64
66
 
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.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masato Ishimoto