pebblebed 0.0.49 → 0.0.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,12 +4,12 @@ module Pebblebed
4
4
  module RSpecHelper
5
5
  def god!(options = {})
6
6
  options.delete(:god)
7
- stub_current_identity(options.merge(:id => 1, :god => true))
7
+ stub_current_identity({:id => 1, :god => true}.merge(options))
8
8
  end
9
9
 
10
10
  def user!(options = {})
11
11
  options.delete(:god)
12
- stub_current_identity(options.merge(:id => 1, :god => false))
12
+ stub_current_identity({:id => 1, :god => false}.merge(options))
13
13
  end
14
14
 
15
15
  def guest!
@@ -22,7 +22,7 @@ module Pebblebed
22
22
 
23
23
  def another_identity
24
24
  id = current_identity ? (current_identity.id + 1) : 1
25
- DeepStruct.wrap(default_identity_options.merge(:id => id, :god => false))
25
+ DeepStruct.wrap({:id => id, :god => false}.merge(default_identity_options))
26
26
  end
27
27
 
28
28
  private
@@ -74,6 +74,7 @@ module Pebblebed
74
74
  end
75
75
  end
76
76
  owned_capabilities = collected_roles.map{|c| c[:capabilities]}.flatten.compact.uniq
77
+ owned_requirements = collected_roles.map{|c| c[:requirements]}.flatten.compact.uniq
77
78
  all_capabilities = self.class.roles.map{|r| r[:capabilities]}.flatten.compact.uniq
78
79
  the_role.merge!(:upgrades => begin
79
80
  upgraders = {}
@@ -81,7 +82,7 @@ module Pebblebed
81
82
  next if owned_capabilities.include?(c)
82
83
  self.class.roles.select{|r| r[:capabilities].include?(c)}.each do |r|
83
84
  upgraders[c] ||= []
84
- upgraders[c] << r[:requirements]
85
+ upgraders[c] << r[:requirements] - owned_requirements
85
86
  upgraders[c].flatten!.uniq!
86
87
  end
87
88
  end
@@ -1,3 +1,3 @@
1
1
  module Pebblebed
2
- VERSION = "0.0.49"
2
+ VERSION = "0.0.50"
3
3
  end
@@ -111,7 +111,7 @@ describe Pebblebed::Security::RoleSchema do
111
111
  }
112
112
 
113
113
  it "returns the idenitified role" do
114
- schema.role.should == {:current=>:identified, :capabilities=>[:kudo], :upgrades=>{:comment=>[:logged_in, :verified_mobile]}}
114
+ schema.role.should == {:current=>:identified, :capabilities=>[:kudo], :upgrades=>{:comment=>[:verified_mobile]}}
115
115
  end
116
116
 
117
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pebblebed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.49
4
+ version: 0.0.50
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-08 00:00:00.000000000 Z
13
+ date: 2013-04-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec