compose / shoegaze Goto Github PK
View Code? Open in Web Editor NEWCreate mocks of modules (especially clients) with easily-defined scenarios (success, invalid, etc)
License: MIT License
Create mocks of modules (especially clients) with easily-defined scenarios (success, invalid, etc)
License: MIT License
For class with argumented initializer, shoegaze doesn't mock class initialize
function, then instantiation like FakeClass.proxy.new(args)
fails with following error:
1) FakeTest works with customized initializer in shoegaze
Failure/Error: subject { FakeTest.proxy.new("dummy") }
ArgumentError:
wrong number of arguments (given 1, expected 0)
class TestClass
def initialize(dummy)
end
end
class FakeTest < Shoegaze::Mock
mock "TestClass"
implement_instance_method :initialize do
default do
datasource do |*arg|
"instance method implementation doesn't help, \
because `missing_method` wasn't hit at all."
end
end
end
end
describe FakeTest do
subject { FakeTest.proxy.new("dummy") }
it "works with customized initializer in shoegaze" do
expect(subject).to be_kind_of Shoegaze::Proxy::Template
end
end
Should this return a class rather than an instance?
We should be able to do something like:
FakeThing.reset
... to clear all the orchestrations. Right now the orchestrations can persist across tests.
Currently you can orchestrate the top-level call with default scenarios underneath:
API::FakeAccountsClient::V2.class_call(:oauth_access_tokens).yields(:success)
API::FakeAccountsClient::V2.oauth_access_tokens.create
success!
But that would also make the following succeed:
API::FakeAccountsClient::V2.class_call(:oauth_access_tokens).yields(:success)
API::FakeAccountsClient::V2.oauth_access_tokens.destroy
success!
... which may not provide sufficiently fine-grained control.
I'd like to be able to do something like:
API::FakeAccountsClient::V2.class_call(:oauth_access_tokens, :create).yields(:success)
Or maybe even:
API::FakeAccountsClient::V2.class_call(:oauth_access_tokens, :create).yields(:success, :failure)
You get the idea. The syntax is up for discussion.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.