socialcast 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use ree-1.8.7-2011.03@socialcast-command-line --create
@@ -89,7 +89,7 @@ module Socialcast
89
89
  return
90
90
  end
91
91
 
92
- fail "Unable to load configuration file: #{config_file}" unless File.exist?(config_file)
92
+ fail "Unable to load configuration file: #{config_file}" unless File.exists?(config_file)
93
93
  say "Using configuration file: #{config_file}"
94
94
  config = YAML.load_file config_file
95
95
  required_mappings = %w{email first_name last_name}
@@ -1,3 +1,3 @@
1
1
  module Socialcast
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
data/spec/cli_spec.rb CHANGED
@@ -2,6 +2,25 @@ require 'spec_helper'
2
2
 
3
3
  describe Socialcast::CLI do
4
4
  describe '#provision' do
5
+ context 'with absolute path to ldap.yml file' do
6
+ before do
7
+ @entry = Net::LDAP::Entry.new("dc=example,dc=com")
8
+ @entry[:mail] = 'ryan@example.com'
9
+ Net::LDAP.any_instance.stub(:search).and_yield(@entry)
10
+
11
+ @result = ''
12
+ Zlib::GzipWriter.stub(:open).and_yield(@result)
13
+
14
+ File.should_receive(:open).with('/my/path/to/ldap.yml').and_yield(File.read(File.join(File.dirname(__FILE__), 'fixtures', 'ldap_without_permission_mappings.yml')))
15
+ File.should_receive(:exists?).with('/my/path/to/ldap.yml').and_return(true)
16
+ File.stub(:open).with(/users.xml.gz/, anything).and_yield(@result)
17
+ File.stub(:open).with(/credentials.yml/).and_yield(File.read(File.join(File.dirname(__FILE__), 'fixtures', 'credentials.yml')))
18
+ RestClient::Resource.any_instance.stub(:post)
19
+
20
+ Socialcast::CLI.start ['provision', '-c', '/my/path/to/ldap.yml']
21
+ end
22
+ it 'resolves absolute path without using current process directory' do end # see expectations
23
+ end
5
24
  context 'with ldap.yml configuration excluding permission_mappings' do
6
25
  before do
7
26
  @entry = Net::LDAP::Entry.new("dc=example,dc=com")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialcast
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 5
10
- version: 1.0.5
9
+ - 6
10
+ version: 1.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek
@@ -143,6 +143,7 @@ files:
143
143
  - .document
144
144
  - .gitignore
145
145
  - .rspec
146
+ - .rvmrc
146
147
  - CONTRIBUTORS.txt
147
148
  - Gemfile
148
149
  - LICENSE.txt