Git Product home page Git Product logo

Comments (19)

alloy avatar alloy commented on August 23, 2024

@wordofchristian I was just thinking the same! Did you start on it already?

from kif.

foxyblocks avatar foxyblocks commented on August 23, 2024

Yep here's a gist https://gist.github.com/1934198

from kif.

foxyblocks avatar foxyblocks commented on August 23, 2024

The podspec doesn't do everything. You would still need to create the testing target and set it to use the generated .xcconfig file for its configuration.

The KIF pod would be added to a new dependency group in the Podfile

target :integration do
      dependency 'KIF', '~> 0.1'
end

This generates an Pods-integration.xcconfig file. in the Pods project. I had to add to my main project before I could set my test target to use it. Not sure if this is a bug or what.

from kif.

alloy avatar alloy commented on August 23, 2024

@wordofchristian It’s not a bug, in so many words, rather a current limitation ;) I.e. currently CocoaPods only configures your main target. In the future it will be possible to configure all targets.

Btw, you probably want to specify the target as :integration, :exclusive => true, so that it doesn’t include any other dependencies defined in the default target (outside of the target block), if you have any.

Going to try the spec now!

from kif.

foxyblocks avatar foxyblocks commented on August 23, 2024

@alloy Won't the integration test target need to include the same dependencies that your normal target has?

from kif.

alloy avatar alloy commented on August 23, 2024

Just started and I stand corrected.

I had expected that KIF would use a bundle in the same way that Xcode sets-up a unit-testing target, in which case you want exclusive, but in this case the runner app is completely isolated from the app target.

from kif.

foxyblocks avatar foxyblocks commented on August 23, 2024

Right, for a unit testing target you would want the exclusive => true option.

On Tuesday, February 28, 2012 at 11:22 AM, Eloy Durán wrote:

Just started and I stand corrected.

I had expected that KIF would use a bundle in the same way that Xcode sets-up a unit-testing target, in which case you want exclusive, but in this case the runner app is completely isolated from the app target.


Reply to this email directly or view it on GitHub:
#114 (comment)

from kif.

alloy avatar alloy commented on August 23, 2024

@wordofchristian Ok, I’ve updated your version and verified it works with the KIF example app. Shall I push it to the main specs repo under your name?

from kif.

alloy avatar alloy commented on August 23, 2024

For now it’s labeled as version 0.0.1, but it would be great if you guys can tag a version in the repo so that it actually maps to something, rather than a arbitrary commit hash. Or, if you want to wait, send us a message once you do, or a pull request :)

Finally, like @wordofchristian said, if you add a copy of the podspec to the root of your repo, then people can install the bleeding-edge version directly from your repo. I can create a pull request for this if you’d like?

from kif.

foxyblocks avatar foxyblocks commented on August 23, 2024

Also, until it's part of the KIF repo or the CocoaPods/Specs repo you can just define it in your Podfile.

Here's my example Podfile.

platform :ios

dependency 'SVProgressHUD', '~> 0.6'

target :test, :exclusive => true do
  dependency 'Kiwi', '~> 1.0'
end


#just for KIF
target :integration do

  # If no podspec is available anywhere, you can define one right in your Podfile
  dependency do |s|
    s.name         = 'KIF'
    s.version      = '0.0.1'
    s.platform     = :ios
    s.source       = {:git => 'https://github.com/square/KIF',
                      :commit => '7d78430cdb7a0e9067cb57bb82ecbd651b6ed8c7' }

    s.source_files = 'Classes', 'Additions'
    s.xcconfig     = {  'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) RUN_KIF_TESTS=1' }

  end
end

from kif.

cdmwebs avatar cdmwebs commented on August 23, 2024

@alloy any reason this wasn't added? I can't find any other issues. Is there something I can help with?

from kif.

alloy avatar alloy commented on August 23, 2024

@cdmwebs No, I simply forgot :) You have push access to the spec repo, right? If so, can you update my gist for the current state of KIF and push it?

from kif.

cdmwebs avatar cdmwebs commented on August 23, 2024

@alloy I doubt I have push access, but I can certainly send a PR. I'll check our spec out and send one.

from kif.

alloy avatar alloy commented on August 23, 2024

@cdmwebs Cool, thanks.

from kif.

cdmwebs avatar cdmwebs commented on August 23, 2024

Just added to Specs: CocoaPods/Specs@59d8453

Who could we ask @square to tag this repo so we can start using that instead? It's currently just tracking master, which is fine with me, but it seems like others might want that.

//cc @mikethole

from kif.

alloy avatar alloy commented on August 23, 2024

@cdmwebs Thanks!

from kif.

cdmwebs avatar cdmwebs commented on August 23, 2024

@wordofchristian looks like this can be closed now.

from kif.

swampie avatar swampie commented on August 23, 2024

using this

#just for KIF
target :integration do

  # If no podspec is available anywhere, you can define one right in your Podfile
  dependency do |s|
    s.name         = 'KIF'
    s.version      = '0.0.1'
    s.platform     = :ios
    s.source       = {:git => 'https://github.com/square/KIF',
                      :commit => '7d78430cdb7a0e9067cb57bb82ecbd651b6ed8c7' }

    s.source_files = 'Classes', 'Additions'
    s.xcconfig     = {  'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) RUN_KIF_TESTS=1' }

  end
end

do I have to follow the KIF integration target generation tutorial or it should be created by cocoapods? will the KIF lib be packaged with the main application on release?

from kif.

phillbaker avatar phillbaker commented on August 23, 2024

For posterity, for an existing iPhone app with CocoaPods, the directions are a bit different than the README steps.

In my existing Podfile, add the ``target` block:

platform :ios, '4.0'

...

# Just for KIF (targets are case sensitive)
target :Integration do
    pod 'KIF' 
end

blow away the Pods/ directory, do a pod install (which takes a while), then duplicate a target in the XCode (like the README) and rename it to match the target in the Podfile, in this case Integration. However, under Build Phases > Link Binary With Libraries, make sure libPods-Integration.a is there, but not libPods.a (if libPods.a is there, you get duplicate symbols).

After that, the tests worked. As a note, since I had to make sure to explicitly call makeKeyAndVisible before the startTestingWithCompletionBlock call in didFinishLaunchingWithOptions.

from kif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.