Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adds support for endpoints "fascinating", "flying", and "outside"
- Loading branch information
Showing
9 changed files
with
166 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module FOaaS | ||
VERSION = "0.1.1" | ||
VERSION = "0.1.2" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Fuck | ||
class Fascinating | ||
include Salutations | ||
|
||
# @param [Hash] options options to send FOaaS | ||
# @option options [String] :name | ||
# @option options [String] :from | ||
# @example | ||
# Fuck::Fascinating.new(from: "Me").call | ||
# => <PayDirt::Result:0x9999eb4 @data= { | ||
# "message"=>"Fascinating story, in what chapter do you shut the fuck up?", | ||
# "subtitle"=>"- Me" | ||
# }, @success=true> | ||
def initialize(options = {}) | ||
options = { | ||
resource: "fascinating", | ||
}.merge(options) | ||
|
||
load_options(:resource, :from, options) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Fuck | ||
class Flying | ||
include Salutations | ||
|
||
# @param [Hash] options options to send FOaaS | ||
# @option options [String] :name | ||
# @option options [String] :from | ||
# @example | ||
# Fuck::Flying.new(from: "Me").call | ||
# => #<PayDirt::Result:0x99e132c @data= { | ||
# "message"=>"I don't give a flying fuck.", | ||
# "subtitle"=>"- Me" | ||
# }, @success=true> | ||
def initialize(options = {}) | ||
options = { | ||
resource: "flying", | ||
}.merge(options) | ||
|
||
load_options(:resource, :from, options) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Fuck | ||
class Outside | ||
include Salutations | ||
|
||
# @param [Hash] options options to send FOaaS | ||
# @option options [String] :name | ||
# @option options [String] :from | ||
# @example | ||
# Fuck::Off.new(name: "You", from: "Me").call | ||
# => #<PayDirt::Result:0x8a544f4 @data= { | ||
# "message"=>"You, why don't you go outside and play hide-and-go-fuck-yourself?", | ||
# "subtitle"=>"- Me" | ||
# }, @success=true> | ||
def initialize(options = {}) | ||
options = { | ||
resource: "outside", | ||
}.merge(options) | ||
|
||
load_options(:resource, :name, :from, options) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'minitest_helper' | ||
|
||
describe Fuck::Fascinating do | ||
before do | ||
@subject = Fuck::Fascinating | ||
@params = { | ||
from: SecureRandom.hex, | ||
} | ||
end | ||
|
||
describe "as a class" do | ||
it "initializes properly" do | ||
@subject.new(@params).must_respond_to :execute! | ||
end | ||
|
||
it "errors when initialized without required dependencies" do | ||
-> { @subject.new(@params.reject { |k| k.to_s == 'from' }) }.must_raise RuntimeError | ||
end | ||
end | ||
|
||
describe "as an instance" do | ||
it "executes successfully" do | ||
result = @subject.new(@params).execute! | ||
result.successful?.must_equal true | ||
result.must_be_kind_of PayDirt::Result | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'minitest_helper' | ||
|
||
describe Fuck::Flying do | ||
before do | ||
@subject = Fuck::Flying | ||
@params = { | ||
from: SecureRandom.hex, | ||
} | ||
end | ||
|
||
describe "as a class" do | ||
it "initializes properly" do | ||
@subject.new(@params).must_respond_to :execute! | ||
end | ||
|
||
it "errors when initialized without required dependencies" do | ||
-> { @subject.new(@params.reject { |k| k.to_s == 'from' }) }.must_raise RuntimeError | ||
end | ||
end | ||
|
||
describe "as an instance" do | ||
it "executes successfully" do | ||
result = @subject.new(@params).execute! | ||
result.successful?.must_equal true | ||
result.must_be_kind_of PayDirt::Result | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'minitest_helper' | ||
|
||
describe Fuck::Outside do | ||
before do | ||
@subject = Fuck::Outside | ||
@params = { | ||
name: SecureRandom.hex, | ||
from: SecureRandom.hex, | ||
} | ||
end | ||
|
||
describe "as a class" do | ||
it "initializes properly" do | ||
@subject.new(@params).must_respond_to :execute! | ||
end | ||
|
||
it "errors when initialized without required dependencies" do | ||
-> { @subject.new(@params.reject { |k| k.to_s == 'name' }) }.must_raise RuntimeError | ||
-> { @subject.new(@params.reject { |k| k.to_s == 'from' }) }.must_raise RuntimeError | ||
end | ||
end | ||
|
||
describe "as an instance" do | ||
it "executes successfully" do | ||
result = @subject.new(@params).execute! | ||
result.successful?.must_equal true | ||
result.must_be_kind_of PayDirt::Result | ||
end | ||
end | ||
end |