zeus-justinf 0.13.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,62 @@
1
+ require 'spec_helper'
2
+
3
+ module Zeus
4
+ describe Rails do
5
+ subject(:rails) { Rails.new }
6
+
7
+ context "#test_helper" do
8
+ before(:each) do
9
+ rails.should_receive(:require).with("minitest/unit")
10
+ end
11
+
12
+ it "when ENV['RAILS_TEST_HELPER'] is set helper is loaded from variable" do
13
+ ENV['RAILS_TEST_HELPER'] = "a_test_helper"
14
+ rails.should_receive(:require).with("a_test_helper")
15
+
16
+ rails.test_helper
17
+ ENV.clear
18
+ end
19
+
20
+ it "when spec_helper exists spec_helper is required" do
21
+ mock_file_existence(ROOT_PATH + "/spec/spec_helper.rb", true)
22
+
23
+ rails.should_receive(:require).with("spec_helper")
24
+
25
+ rails.test_helper
26
+ end
27
+
28
+ it "when minitest_helper exists minitest_helper is required" do
29
+ mock_file_existence(ROOT_PATH + "/spec/spec_helper.rb", false)
30
+ mock_file_existence(ROOT_PATH + "/test/minitest_helper.rb", true)
31
+
32
+ rails.should_receive(:require).with("minitest_helper")
33
+
34
+ rails.test_helper
35
+ end
36
+
37
+ it "when there is no spec_helper or minitest_helper, test_helper is required" do
38
+ mock_file_existence(ROOT_PATH + "/spec/spec_helper.rb", false)
39
+ mock_file_existence(ROOT_PATH + "/test/minitest_helper.rb", false)
40
+
41
+ rails.should_receive(:require).with("test_helper")
42
+
43
+ rails.test_helper
44
+ end
45
+ end
46
+
47
+ context "#gem_is_bundled?" do
48
+ it "returns gem version from Gemfile.lock" do
49
+ File.stub(:read).and_return("
50
+ GEM
51
+ remote: https://rubygems.org/
52
+ specs:
53
+ exception_notification-rake (0.0.6)
54
+ exception_notification (~> 3.0.1)
55
+ rake (>= 0.9.0)
56
+ rake (10.0.4)
57
+ ")
58
+ gem_is_bundled?('rake').should == '10.0.4'
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,38 @@
1
+ require 'zeus/rails'
2
+
3
+ RSpec::Matchers.define :exit_with_code do |exp_code|
4
+ actual = nil
5
+ match do |block|
6
+ begin
7
+ block.call
8
+ rescue SystemExit => e
9
+ actual = e.status
10
+ end
11
+ actual and actual == exp_code
12
+ end
13
+ failure_message_for_should do |block|
14
+ "expected block to call exit(#{exp_code}) but exit" +
15
+ (actual.nil? ? " not called" : "(#{actual}) was called")
16
+ end
17
+ failure_message_for_should_not do |block|
18
+ "expected block not to call exit(#{exp_code})"
19
+ end
20
+ description do
21
+ "expect block to call exit(#{exp_code})"
22
+ end
23
+ end
24
+
25
+ def stub_system_methods
26
+ Dir.stub!(:glob).and_return(["path/to/file.rb"])
27
+ Kernel.stub!(:load).and_return
28
+ end
29
+
30
+ def mock_file_existence(file, result)
31
+ File.should_receive(:exists?).with(file).and_return(result)
32
+ end
33
+
34
+ RSpec.configure do |config|
35
+ config.before(:each) do
36
+ stub_system_methods
37
+ end
38
+ end
data/zeus.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ # This preamble is basically used to deal with bundler/gem_tasks, which loads the gemspec
4
+ # on rake init, even though some prerequisites are not generated until `rake build` is invoked.
5
+ version = begin
6
+ require File.expand_path('../lib/zeus/version', __FILE__)
7
+ Zeus::VERSION
8
+ rescue LoadError
9
+ "0.0.0"
10
+ end
11
+
12
+ files = File.exist?('MANIFEST') ? File.read("MANIFEST").lines.map(&:chomp) : []
13
+
14
+ Gem::Specification.new do |gem|
15
+ gem.authors = ["Burke Libbey"]
16
+ gem.email = ["burke@libbey.me"]
17
+ gem.description = %q{Boot any rails app in under a second}
18
+ gem.summary = %q{Zeus is an intelligent preloader for ruby applications. It allows normal development tasks to be run in a fraction of a second.}
19
+ gem.homepage = "http://zeus.is"
20
+
21
+ gem.files = files
22
+ gem.extensions = ["ext/inotify-wrapper/extconf.rb"]
23
+ gem.executables = ['zeus']
24
+ gem.test_files = []
25
+ gem.name = "zeus-justinf"
26
+ gem.require_paths = ["lib"]
27
+ gem.version = version
28
+ gem.license = "MIT"
29
+
30
+ gem.add_development_dependency "rspec", '~> 2.12.0'
31
+ gem.add_development_dependency "rake"
32
+ gem.add_development_dependency "ronn", '>= 0.7.0'
33
+
34
+ gem.add_runtime_dependency "method_source", ">= 0.6.7"
35
+ end
metadata ADDED
@@ -0,0 +1,126 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: zeus-justinf
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.13.5
5
+ platform: ruby
6
+ authors:
7
+ - Burke Libbey
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 2.12.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 2.12.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ronn
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.7.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.7.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: method_source
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.6.7
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 0.6.7
69
+ description: Boot any rails app in under a second
70
+ email:
71
+ - burke@libbey.me
72
+ executables:
73
+ - zeus
74
+ extensions:
75
+ - ext/inotify-wrapper/extconf.rb
76
+ extra_rdoc_files: []
77
+ files:
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - MIT-LICENSE
81
+ - Rakefile
82
+ - bin/zeus
83
+ - build/zeus-darwin-amd64
84
+ - build/zeus-linux-386
85
+ - build/zeus-linux-amd64
86
+ - ext/inotify-wrapper/extconf.rb
87
+ - ext/inotify-wrapper/inotify-wrapper.cpp
88
+ - lib/zeus.rb
89
+ - lib/zeus/load_tracking.rb
90
+ - lib/zeus/m.rb
91
+ - lib/zeus/m/test_collection.rb
92
+ - lib/zeus/m/test_method.rb
93
+ - lib/zeus/plan.rb
94
+ - lib/zeus/rails.rb
95
+ - lib/zeus/version.rb
96
+ - spec/fake_mini_test.rb
97
+ - spec/m_spec.rb
98
+ - spec/rails_spec.rb
99
+ - spec/spec_helper.rb
100
+ - zeus.gemspec
101
+ homepage: http://zeus.is
102
+ licenses:
103
+ - MIT
104
+ metadata: {}
105
+ post_install_message:
106
+ rdoc_options: []
107
+ require_paths:
108
+ - lib
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - ! '>='
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ requirements: []
120
+ rubyforge_project:
121
+ rubygems_version: 2.2.2
122
+ signing_key:
123
+ specification_version: 4
124
+ summary: Zeus is an intelligent preloader for ruby applications. It allows normal
125
+ development tasks to be run in a fraction of a second.
126
+ test_files: []