shelly 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +14 -1
- data/lib/shelly/cli.rb +3 -1
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/cli_spec.rb +3 -3
- metadata +3 -3
data/README.md
CHANGED
data/lib/shelly/cli.rb
CHANGED
@@ -23,7 +23,9 @@ module Shelly
|
|
23
23
|
end
|
24
24
|
|
25
25
|
user = User.new(email, password)
|
26
|
-
|
26
|
+
if user.register
|
27
|
+
say "Successfully registered!\nCheck you mailbox for email confirmation"
|
28
|
+
end
|
27
29
|
rescue Client::APIError => e
|
28
30
|
if e.message == "Validation Failed"
|
29
31
|
e.errors.each { |error| say "#{error.first} #{error.last}" }
|
data/lib/shelly/version.rb
CHANGED
data/spec/shelly/cli_spec.rb
CHANGED
@@ -68,9 +68,9 @@ describe Shelly::CLI do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
context "on successful registration" do
|
71
|
-
it "should
|
71
|
+
it "should display message about registration and email confirmation" do
|
72
72
|
@client.stub(:register_user).and_return(true)
|
73
|
-
$stdout.should_receive(:puts).with("
|
73
|
+
$stdout.should_receive(:puts).with("Successfully registered!\nCheck you mailbox for email confirmation")
|
74
74
|
fake_stdin(["kate@example.com", "pass"]) do
|
75
75
|
@cli.register
|
76
76
|
end
|
@@ -78,7 +78,7 @@ describe Shelly::CLI do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
context "on unsuccessful registration" do
|
81
|
-
it "should
|
81
|
+
it "should display errors" do
|
82
82
|
response = {"message" => "Validation Failed", "errors" => [["email", "has been already taken"]]}
|
83
83
|
exception = Shelly::Client::APIError.new(response)
|
84
84
|
@client.stub(:register_user).and_raise(exception)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Shelly Cloud team
|