Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Jul 9, 2010
0 parents commit 26fcff8
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*.gem
13 changes: 13 additions & 0 deletions Rakefile
@@ -0,0 +1,13 @@
require 'rubygems'
require 'rake'
require 'spec/rake/spectask'

spec_files = Rake::FileList["spec/**/*_spec.rb"]

desc "Run specs"
Spec::Rake::SpecTask.new do |t|
t.spec_files = spec_files
t.spec_opts = ["-c"]
end

task :default => :spec
1 change: 1 addition & 0 deletions lib/enlighten.rb
@@ -0,0 +1 @@
require "enlighten/middleware"
11 changes: 11 additions & 0 deletions lib/enlighten/middleware.rb
@@ -0,0 +1,11 @@
module Enlighten
class Middleware
def initialize(app)
@app = app
end

def call(env)
@app.call(env)
end
end
end
13 changes: 13 additions & 0 deletions spec/enlighten/middleware_spec.rb
@@ -0,0 +1,13 @@
require "spec_helper"

describe Enlighten::Middleware, "simple app" do
before(:each) do
app = proc { |e| [200, {}, ["hello"]] }
middleware = Enlighten::Middleware.new(app)
@request = Rack::MockRequest.new(middleware)
end

it "should pass normal requests through without modification" do
@request.get("/foobar").body.should == "hello"
end
end
8 changes: 8 additions & 0 deletions spec/spec_helper.rb
@@ -0,0 +1,8 @@
require "rubygems"
require "spec"
require "rack"
require "enlighten"

Spec::Runner.configure do |config|
config.mock_with :rr
end

0 comments on commit 26fcff8

Please sign in to comment.