basic_assumption 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  BasicAssumption
2
2
  ===============
3
3
 
4
- A clone of DecentExposure, with less shared-state in its specs.
4
+ A clone of decent_exposure, with less shared-state in its specs. Check the configuration options for enabling the decent_exposure API.
5
5
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -1,3 +1,5 @@
1
+ require 'basic_assumption/configuration'
2
+
1
3
  module BasicAssumption
2
4
  def self.extended(base)
3
5
  base.default_assumption {}
@@ -0,0 +1,14 @@
1
+ module BasicAssumption
2
+ class Configuration
3
+ def self.configure
4
+ yield self.new
5
+ end
6
+
7
+ def emulate_exposure!
8
+ BasicAssumption.module_eval do
9
+ alias expose assume
10
+ alias default_exposure default_assumption
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe BasicAssumption::Configuration do
4
+ it "provides a #configure class method that yields an instance of the class" do
5
+ configuration_instance = nil
6
+ BasicAssumption::Configuration.configure { |instance| configuration_instance = instance }
7
+ configuration_instance.should be_a_kind_of(BasicAssumption::Configuration)
8
+ end
9
+
10
+ context "an instance" do
11
+ class Exposer
12
+ extend BasicAssumption
13
+ end
14
+ let(:instance) { BasicAssumption::Configuration.new }
15
+ let(:exposing_class) { Exposer }
16
+ it "allows decent_exposure emulation mode" do
17
+ instance.emulate_exposure!
18
+ exposing_class.should respond_to(:expose)
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 2
9
- version: 0.2.2
8
+ - 3
9
+ version: 0.2.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt Yoho
@@ -71,6 +71,7 @@ files:
71
71
  - README.md
72
72
  - VERSION
73
73
  - lib/basic_assumption.rb
74
+ - lib/basic_assumption/configuration.rb
74
75
  - rails/init.rb
75
76
  has_rdoc: true
76
77
  homepage: http://github.com/mattyoho/basic_assumption
@@ -105,3 +106,4 @@ summary: Allows a simple declarative idiom for resources in controllers and view
105
106
  test_files:
106
107
  - spec/spec_helper.rb
107
108
  - spec/lib/basic_assumption_spec.rb
109
+ - spec/lib/basic_assumption/configuration_spec.rb