wycats / artifice Goto Github PK
View Code? Open in Web Editor NEWReplaces Net::HTTP with a subclass that routes all requests to a Rack application
Home Page: http://www.yehudakatz.com
License: MIT License
Replaces Net::HTTP with a subclass that routes all requests to a Rack application
Home Page: http://www.yehudakatz.com
License: MIT License
I'm switching away from a modified fakeweb I built into my Web service stubbing gem: Fredo. It was easy to replace and for free I oet an extra spec passing that I didn't get around fixing. Thanks!
On the downside three specs that involve requests not resolved by the rack endpoint being forwarded to the web went red.
I was wondering if it would it be possible, if the endpoint passed to Artifice returns a 404 to have Artifice revert back to the usual Net::HTTP connection if instructed to do so? Like fakeweb does.
I love Artifice!
So much so that I want to use it to test my iPhone app that talks to Facebook via the facebook-ios-sdk (for Facebook Connect) via NSURLConnection
, I think.
http://stackoverflow.com/questions/5329784/artifice-for-objective-c
Currently says N/A
:
https://rubygems.org/gems/artifice
Could you release a new gem version containing the latest commit? (POST fix)
thanks :)
Title says it all.
[00:37:33] [Client thread/WARN] [Artifice]: Couldn't load Chisel compat
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: java.lang.ClassNotFoundException: info.jbcs.minecraft.chisel.ChiselBlocks
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.ClassLoader.loadClass(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.ClassLoader.loadClass(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Class.forName0(Native Method)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.Class.forName(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at shukaro.artifice.compat.Chisel.load(Chisel.java:20)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at shukaro.artifice.ArtificeCore.init(ArtificeCore.java:113)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventBus.post(EventBus.java:275)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at com.google.common.eventbus.EventBus.post(EventBus.java:275)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:541)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:867)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.client.main.Main.main(SourceFile:148)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at java.lang.reflect.Method.invoke(Unknown Source)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:286)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:376)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.multimc.EntryPoint.listen(EntryPoint.java:165)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: at org.multimc.EntryPoint.main(EntryPoint.java:54)
[00:37:33] [Client thread/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:-1]: Caused by: java.lang.NullPointerException
Not sure if paulj has submitted a pull request to you, but he has a fix worth merging: http://github.com/paulj/artifice/commit/6511e455b00792c663b054e541ba2a61a1a4ee88
If I create a Net::HTTP request like so:
request = Net::HTTP::Post.new(url.path, 'Accept' => 'application/json')
request.set_form_data(fields)
response = Net::HTTP.new(url.host).start { |http| http.request(request) }
The body set on the request (via set_form_data) is not used in your overridden request method.
This causes problems with HTTParty as well.
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.