rack-when 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b73f8a82cd00f596135764e8a2944bc4540ab425
4
- data.tar.gz: d1e40d6b2049bf8436b7dc36e01e8f5dedb48922
3
+ metadata.gz: ced1acc516b045e072e95a29bf2f424be8543510
4
+ data.tar.gz: 4e93b0e986a57f1b7e9f288fd53a7d6a9b0c820a
5
5
  SHA512:
6
- metadata.gz: 814df7decc343898d7bdf64258e329708991bddf05c192587f0c6968b35d95517d9b7535c13a7f7ee0003100e42bbe29b94abb80440052f2cc80901c31bbece1
7
- data.tar.gz: 29d286a876cc77eb36660ca7f3acbd74ee777a8522de073027934d367cd2f032e8688171a01c9964da187249508400458d93c2d2e8d0c106bf7f325b126deb1b
6
+ metadata.gz: b19f7823cb0da59df873f10de8e73d3815ee1deadfbace4d6f95159a171ba62bd8306273db39f31a93ee564b08ceed48d0c42c0d013310c8ed2c3490cf78f3e6
7
+ data.tar.gz: e7b34801c85c176b1a6e0243c501bdeda702dfa9a71f3a25a0b45e6e47d6e16bc357d638e3bba6c395320daff58602dca4f720f81c44396a6695713b2e97a9a3
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/Rakefile CHANGED
@@ -1 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ require 'rspec'
4
+ require 'rspec/core/rake_task'
5
+
6
+ desc "Run specs"
7
+ RSpec::Core::RakeTask.new :spec do |task|
8
+ task.pattern = 'spec/**/*_spec.rb'
9
+ end
10
+
11
+ task default: :spec
@@ -2,7 +2,7 @@ module Rack
2
2
  module When
3
3
  class Builder
4
4
 
5
- def initialize env, &block
5
+ def initialize env, block
6
6
  @env, @block = env, block
7
7
  end
8
8
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module When
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -3,8 +3,8 @@ require 'rack/when/builder'
3
3
  describe 'An environment sensitive rack builder' do
4
4
 
5
5
  describe '#mount rack_up' do
6
- let(:builder) { Rack::When::Builder.new @env, &block }
7
- let(:block) { -> {} }
6
+ let(:builder) { Rack::When::Builder.new @env, block }
7
+ let(:block) { double "block" }
8
8
  let(:mount_builder) { builder.mount }
9
9
 
10
10
  it 'will run the block when enviroment matches' do
@@ -34,18 +34,18 @@ describe 'An environment sensitive rack builder' do
34
34
  describe '#current_env_matches?' do
35
35
  shared_examples_for 'matching environment' do
36
36
  it 'is true when matched' do
37
- expect(Rack::When::Builder.new :development ).to have_matching_env
38
- expect(Rack::When::Builder.new 'development').to have_matching_env
39
- expect(Rack::When::Builder.new 'DeVelopment').to have_matching_env
37
+ expect(Rack::When::Builder.new :development, double ).to have_matching_env
38
+ expect(Rack::When::Builder.new 'development', double ).to have_matching_env
39
+ expect(Rack::When::Builder.new 'DeVelopment', double ).to have_matching_env
40
40
  end
41
41
 
42
42
  it 'is true when matched as partial' do
43
- expect(Rack::When::Builder.new :dev ).to have_matching_env
44
- expect(Rack::When::Builder.new 'dev').to have_matching_env
43
+ expect(Rack::When::Builder.new :dev, double ).to have_matching_env
44
+ expect(Rack::When::Builder.new 'dev', double ).to have_matching_env
45
45
  end
46
46
 
47
47
  it 'is false when mismatched' do
48
- expect(Rack::When::Builder.new :staging).to_not have_matching_env
48
+ expect(Rack::When::Builder.new :staging, double ).to_not have_matching_env
49
49
  end
50
50
  end
51
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-when
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Rowe
metadata.gz.sig CHANGED
Binary file