magic_lamp 1.3.0 → 1.3.1

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.
@@ -1 +1 @@
1
- MagicLamp.registered_fixtures
1
+ MagicLamp.registered?("spec")
@@ -0,0 +1 @@
1
+ MagicLamp.registered?("test")
@@ -0,0 +1,3 @@
1
+ MagicLamp.fixture(name: "from_test_directory") do
2
+ render text: ""
3
+ end
@@ -151,6 +151,7 @@ describe('Genie', function() {
151
151
  it('requests all of the fixtures and puts them in the cache', function() {
152
152
  subject.preload();
153
153
  expect(subject.cache).to.have.keys([
154
+ 'from_test_directory',
154
155
  'orders/foo',
155
156
  'orders/bar',
156
157
  'orders/form',
@@ -229,8 +229,9 @@ describe MagicLamp do
229
229
  end
230
230
 
231
231
  describe "#load_config" do
232
- it "loads the magic lamp config file" do
233
- expect(subject).to receive(:registered_fixtures)
232
+ it "loads the magic lamp config file from the spec and test directories" do
233
+ expect(subject).to receive(:registered?).with("spec")
234
+ expect(subject).to receive(:registered?).with("test")
234
235
  subject.load_config
235
236
  end
236
237
 
@@ -242,11 +243,16 @@ describe MagicLamp do
242
243
  end
243
244
 
244
245
  describe "#load_lamp_files" do
245
- it "loads all lamp files" do
246
+ it "loads all lamp files from the spec directory" do
246
247
  subject.load_lamp_files
247
248
  expect(subject.registered_fixtures["orders/foo"]).to be_a(Hash)
248
249
  end
249
250
 
251
+ it "loads all lamp files from the test directory" do
252
+ subject.load_lamp_files
253
+ expect(subject.registered_fixtures["from_test_directory"]).to be_a(Hash)
254
+ end
255
+
250
256
  it "blows out registered_fixtures on each call" do
251
257
  old_registry = subject.registered_fixtures
252
258
  subject.load_lamp_files
@@ -327,23 +333,4 @@ describe MagicLamp do
327
333
  expect(form_fixture).to match(/<div class="actions"/)
328
334
  end
329
335
  end
330
-
331
- describe "#path" do
332
- context "spec directory" do
333
- let(:spec_path) { Rails.root.join("spec") }
334
-
335
- it "returns a default path starting from spec" do
336
- expect(subject.path).to eq(spec_path)
337
- end
338
- end
339
-
340
- context "no spec directory" do
341
- let(:test_path) { Rails.root.join("test") }
342
-
343
- it "returns a default path starting from test" do
344
- allow(Dir).to receive(:exist?).and_return(false)
345
- expect(subject.path).to eq(test_path)
346
- end
347
- end
348
- end
349
336
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magic_lamp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Crismali
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-27 00:00:00.000000000 Z
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -281,6 +281,8 @@ files:
281
281
  - spec/dummy/spec/magical/a_lamp_file_with_a_different_name_lamp.rb
282
282
  - spec/dummy/spec/magical/magic_lamp.rb
283
283
  - spec/dummy/spec/magical/magic_lamp_config.rb
284
+ - spec/dummy/test/magic_lamp_config.rb
285
+ - spec/dummy/test/test_lamp.rb
284
286
  - spec/dummy/tmp/cache/assets/development/sprockets/020414588350dc7f6c910d23b47b2eac
285
287
  - spec/dummy/tmp/cache/assets/development/sprockets/04a1e26a9e3fde1f448cb2a9d382fbbc
286
288
  - spec/dummy/tmp/cache/assets/development/sprockets/05ecd34d23e110728a2f04ad35ec8834
@@ -411,7 +413,7 @@ files:
411
413
  - spec/teaspoon_env.rb
412
414
  homepage: https://github.com/crismali/magic_lamp
413
415
  licenses:
414
- - Apache
416
+ - Apache 2.0
415
417
  metadata: {}
416
418
  post_install_message:
417
419
  rdoc_options: []
@@ -490,6 +492,8 @@ test_files:
490
492
  - spec/dummy/spec/magical/a_lamp_file_with_a_different_name_lamp.rb
491
493
  - spec/dummy/spec/magical/magic_lamp.rb
492
494
  - spec/dummy/spec/magical/magic_lamp_config.rb
495
+ - spec/dummy/test/magic_lamp_config.rb
496
+ - spec/dummy/test/test_lamp.rb
493
497
  - spec/dummy/tmp/cache/assets/development/sprockets/020414588350dc7f6c910d23b47b2eac
494
498
  - spec/dummy/tmp/cache/assets/development/sprockets/04a1e26a9e3fde1f448cb2a9d382fbbc
495
499
  - spec/dummy/tmp/cache/assets/development/sprockets/05ecd34d23e110728a2f04ad35ec8834