chicago 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -22,11 +22,6 @@ Rake::TestTask.new("test:shoulda") do |t|
22
22
  t.verbose = true
23
23
  end
24
24
 
25
- # task :test => [:set_test_env] do
26
- # $:.concat ['./lib', './test/shoulda_tests']
27
- # Dir.glob("./test/shoulda_tests/*_test.rb").each { |test| require test }
28
- # end
29
-
30
25
  desc "Open an irb session preloaded with this library"
31
26
  task :console do
32
27
  exec "irb -rubygems"
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.3.7
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chicago}
8
- s.version = "0.3.6"
8
+ s.version = "0.3.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin 'Gus' Knowlden"]
12
- s.date = %q{2009-11-21}
12
+ s.date = %q{2009-12-14}
13
13
  s.description = %q{Sinatra runtime and testing extensions used commonly by Thumblemonks. For example, :json_response, which turns an object into JSON and sets the content-type appropriately.}
14
14
  s.email = %q{gus@gusg.us}
15
15
  s.extra_rdoc_files = [
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
20
20
  "MIT-LICENSE",
21
21
  "README.markdown",
22
22
  "Rakefile",
23
+ "VERSION",
23
24
  "chicago.gemspec",
24
25
  "lib/chicago.rb",
25
26
  "lib/chicago/application.rb",
@@ -1 +1,36 @@
1
- require 'chicago/riot/macros'
1
+ require 'chicago/riot/macros'
2
+ require 'rack/test'
3
+
4
+ class Riot::Situation
5
+ include Rack::Test::Methods
6
+
7
+ # Allows Rack test methods to work in your Riot tests. Simply do this in your setup or test method:
8
+ #
9
+ # context "MyApp" do
10
+ # setup { @app = MyApp }
11
+ #
12
+ # context "get /foo" do
13
+ # setup { get "/foo" }
14
+ # # ... tests ...
15
+ # end
16
+ # end
17
+ def app
18
+ @app
19
+ end
20
+
21
+ # Sets up a Sinatra::Base subclass defined with the block given. Used in setup or individual test methods
22
+ # to define an application
23
+ #
24
+ # context "get /foo" do
25
+ # setup do
26
+ # mock_app {
27
+ # get("/foo") { stuff; status 200; }
28
+ # }
29
+ # get "/foo"
30
+ # end
31
+ # asserts_response_status 200
32
+ # end
33
+ def mock_app(base=Sinatra::Base, &block)
34
+ @app = Sinatra.new(base, &block)
35
+ end
36
+ end
@@ -3,20 +3,7 @@
3
3
  end
4
4
 
5
5
  class Riot::Situation
6
- include Rack::Test::Methods
7
-
8
- # Sets up a Sinatra::Base subclass defined with the block
9
- # given. Used in setup or individual spec methods to establish
10
- # the application.
11
- def mock_app(base=Sinatra::Base, &block)
12
- @app = Sinatra.new(base, &block)
13
- end
14
-
15
6
  def extend_mock_app(&block)
16
7
  @app.instance_eval(&block)
17
8
  end
18
-
19
- def app
20
- @app
21
- end
22
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chicago
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin 'Gus' Knowlden
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-21 00:00:00 -06:00
12
+ date: 2009-12-14 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -45,6 +45,7 @@ files:
45
45
  - MIT-LICENSE
46
46
  - README.markdown
47
47
  - Rakefile
48
+ - VERSION
48
49
  - chicago.gemspec
49
50
  - lib/chicago.rb
50
51
  - lib/chicago/application.rb