-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- encoding : utf-8 -*- | ||
module RegApi2 | ||
# REG.API bill category | ||
module Bill | ||
|
||
include RegApi2::Builder | ||
|
||
category :bill | ||
|
||
# @!method nop(opts = {}) | ||
# @param [Hash] opts | ||
# @option opts [String] :bill_id Invoice number in case of a single-invoice request. | ||
# @option opts [Array] :bills A list if invoice numbers. | ||
# For testing purposes. | ||
# @return [NilClass or Hash(bills)] nil or bills. | ||
# @note Support of invoice lists: yes | ||
# @example Get single bill | ||
# RegApi2.bill.nop bill_id: 12345 | ||
# @example Get bills | ||
# RegApi2.bill.nop bills: ["12345","12346"] | ||
define :nop | ||
|
||
extend self | ||
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 @@ | ||
# -*- encoding : utf-8 -*- | ||
|
||
describe RegApi2::Bill do | ||
describe :nop do | ||
it "should raise nothing" do | ||
lambda { RegApi2.bill.nop }.should_not raise_error | ||
end | ||
|
||
it "should return nil" do | ||
RegApi2.bill.nop.should be_nil | ||
end | ||
|
||
it "should return bill if specified" do | ||
RegApi2.bill.nop(bill_id: 12345).bills.should have(1).bill | ||
end | ||
|
||
it "should return bills if specified" do | ||
RegApi2.bill.nop(bills: [ 12345, 12346 ]).bills.should have(2).bills | ||
end | ||
end | ||
|
||
end |