socks 0.0.8.beta → 0.1.8.beta

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -2,7 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.2
4
4
  - 1.9.3
5
- - rbx-19mode
6
5
  notifications:
7
6
  recipients:
8
7
  - main@seven7.flowdock.com
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ - 0.1.8.beta
2
+ * Setup RSpec as default test framework
3
+ * Get simple RSpec tests using Rack operating
4
+
1
5
  - 0.0.8.beta
2
6
  * Bug fixes
3
7
  * Cleanup
data/README.md CHANGED
@@ -49,6 +49,27 @@ Take a look, you should see the following text appear in your web browser:
49
49
 
50
50
  This is my first Socks app!
51
51
 
52
+ ## Adding tests for Socks apps
53
+
54
+ Socks comes with built-in support for RSpec matchers and DSL. It also comes with a built-in `spec_helper.rb` in the `spec/`directory.
55
+
56
+ Paste in the following to test the simple Socks app in the quickstart:
57
+
58
+ ```ruby
59
+ require 'spec_helper'
60
+ require File.expand_path("../../config/router.rb", __FILE__)
61
+
62
+ describe Myapp::Router do
63
+ let(:request) { Rack::MockRequest.new(Myapp::Router) }
64
+
65
+ it 'returns something at /' do
66
+ request.get('/').should == "This is my first Socks app!"
67
+ end
68
+
69
+ end
70
+ end
71
+ ```
72
+
52
73
  ## Contributing
53
74
 
54
75
  1. Fork it
@@ -61,6 +82,8 @@ Take a look, you should see the following text appear in your web browser:
61
82
 
62
83
  See LICENSE (MIT).
63
84
 
85
+ [More on MIT »](http://www.opensource.org/licenses/MIT)
86
+
64
87
  ## TODO
65
88
 
66
89
  See TODO.md
data/bin/socks CHANGED
@@ -69,8 +69,10 @@ gem \"http_router\"
69
69
  # Use Warden for authentication
70
70
  # gem \"warden\"
71
71
 
72
- # Use RSpec for tests
73
- gem \"rspec\""
72
+ group :development, :test do
73
+ # Use RSpec for tests
74
+ gem \"rspec\"
75
+ end"
74
76
 
75
77
  rakefile = "# Socks generates many helpful Rake tasks for you!
76
78
  require \"socks\"
@@ -91,15 +93,28 @@ module #{app.capitalize}
91
93
  end
92
94
  "
93
95
 
96
+ ########################
97
+ # Spec-helper template #
98
+ ########################
99
+
100
+ spec_helper = "# Default helpers for your specs are added here
101
+ require \"rspec\"
102
+ require \"rack\"
103
+ "
104
+
105
+ dotrspec = "--color
106
+ --format documentation"
107
+
108
+
94
109
  # -------------------------------------------------------------------------
95
110
  # Creation |
96
111
  # -------------------------------------------------------------------------
97
112
 
98
113
  FileUtils.mkdir app
99
114
  FileUtils.cd app
100
- FileUtils.mkdir %w( app config )
115
+ FileUtils.mkdir %w( app config spec )
101
116
  FileUtils.mkdir %w( app/controllers app/views ) # Sub-dirs
102
- FileUtils.touch %w( config.ru Gemfile Rakefile .gitignore Procfile )
117
+ FileUtils.touch %w( spec/spec_helper.rb .rspec ) # Spec file(s)
103
118
 
104
119
  # -------------------------------------------------------------------------
105
120
  # File Initialization |
@@ -117,6 +132,9 @@ end
117
132
 
118
133
  system("echo '#{router_template}' >> config/router.rb")
119
134
 
135
+ system("echo '#{spec_helper}' >> spec/spec_helper.rb")
136
+ system("echo '#{dotrspec}' >> .rspec")
137
+
120
138
  system("bundle")
121
139
 
122
140
  end
@@ -157,6 +175,14 @@ command :start do |c|
157
175
  end
158
176
  end
159
177
 
178
+ command :test do |c|
179
+ c.syntax = 'socks test [options]'
180
+ c.description = 'Run tests with RSpec'
181
+ c.action do |args, options|
182
+ system('rspec .')
183
+ end
184
+ end
185
+
160
186
  command :version do |c|
161
187
  c.syntax = 'socks version [options]'
162
188
  c.description = 'Display the current version (altertative to --version)'
data/lib/socks/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Socks
2
- VERSION = "0.0.8.beta"
2
+ VERSION = "0.1.8.beta"
3
3
  end
data/socks.gemspec CHANGED
@@ -14,14 +14,13 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "socks"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Socks::VERSION
17
-
18
- # Rack HTTP
19
- gem.add_dependency "rack"
17
+
18
+ gem.add_dependency "rack" # Rack HTTP
20
19
  gem.add_dependency "http_router"
21
20
  gem.add_dependency "commander" # For command-line app
21
+ gem.add_dependency "rspec" # Default testing framework
22
22
 
23
23
  gem.add_development_dependency "rake"
24
- gem.add_development_dependency "rspec"
25
24
  gem.add_development_dependency "guard"
26
25
  gem.add_development_dependency "bundler"
27
26
  gem.add_development_dependency "debugger"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8.beta
4
+ version: 0.1.8.beta
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -60,14 +60,14 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- name: rake
63
+ name: rspec
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
- type: :development
70
+ type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
@@ -76,7 +76,7 @@ dependencies:
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
- name: rspec
79
+ name: rake
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements: