Giter VIP home page Giter VIP logo

cedar's Introduction

Cedar

Build Status Carthage compatible

Cedar is a BDD-style Objective-C testing framework with an expressive matcher DSL and convenient test doubles.

describe(@"Example specs on NSString", ^{
    it(@"lowercaseString returns a new string with everything in lower case", ^{
        [@"FOOBar" lowercaseString] should equal(@"foobar");
    });

    it(@"length returns the number of characters in the string", ^{
        [@"internationalization" length] should equal(20);
    });

    describe(@"isEqualToString:", ^{
        it(@"should return true if the strings are the same", ^{
            [@"someString" isEqualToString:@"someString"] should be_truthy;
        });

        it(@"should return false if the strings are not the same", ^{
            [@"someString" isEqualToString:@"anotherString"] should be_falsy;
        });
    });
});

Quick start

    $ curl -L https://raw.github.com/cedarbdd/cedar/master/install.sh | bash
  • Or if you want to install from HEAD. Run:
    $ bash <(echo "set -- --head; $(curl -L https://raw.github.com/cedarbdd/cedar/master/install.sh)")
  • Restart Xcode
  • Add new spec files to your project's Test Bundle using the Xcode templates
  • Start writing specs!

Documentation

Documentation can be found on the Cedar Wiki.

Support and feedback

Contributing

Please read the Contributor Guide on the wiki.

Maintainers

Copyright (c) 2010-2016 Pivotal Labs. This software is licensed under the MIT License. Mixpanel

cedar's People

Contributors

akitchen avatar alexdenisov avatar artfeel avatar boundsj avatar briancroom avatar cbguder avatar cppforlife avatar i-taptera avatar idoru avatar jeffh avatar loopyzort avatar mjstallard avatar moonmaster9000 avatar mountainstyle avatar nerdyc avatar onsi avatar paultaykalo avatar petejkim avatar pivotal-qfive avatar pivotalcommon avatar pivotalworkstation avatar prayagverma avatar readmecritic avatar reneighbor avatar sconover avatar sgravrock avatar tjarratt avatar wileykestner avatar xoebus avatar xtreme-priyanka-ranjan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cedar's Issues

Upgrade instructions missing

The Rakefile update states that upgrading is as simple as:

system_or_exit %{rsync -vkcr --delete "#{BUILD_DIR}/#{cedar_path}/#{cedar_name}.framework/" "#{args.path_to_framework}/"}

Now I only have to find out what path_to_framework should be to do this on my own.

*Cedar-iOS.framework resides in
~/Library/Developer/Xcode/Templates/Project Templates/Cedar/iOS Cedar Spec Suite.xctemplate/, but I'm developing a Cocoa OS X app.

  • OSX Cedar Spec Suite.xctemplate has a similar structure but isn't a .framework file
  • Weird enough, in Cedar's project templates folder, another .xctemplate is called OS X Cedar Spec Suite.xctemplate (not the additional space before the 'X') -- is this due to me running the install script for the upgrade, and did the script omit deleting old files?

Please provide some additional info. Best way I could come up with is to create a new project, add Cedar target, and copy the resulting .framework file over to my existing projects.


Here's what my shell says when I run rake upgrade. Seemingly, no path is missing (it's inherited by other tasks?).

.cedar[(detached from v0.9.5)*]  $ rake upgrade

No matching processes belonging to you were found
No matching processes belonging to you were found
No matching processes belonging to you were found
Output: /Users/ct/.cedar/build/iosframeworkspecs.output
Executing xcodebuild -project Cedar.xcodeproj -target iOSFrameworkSpecs -configuration Release -sdk iphonesimulator7.0 build ARCHS=i386 SYMROOT='/Users/ct/.cedar/build'
2014-01-31 21:10:28.564 xcodebuild[48477:1007] [MT] PluginLoading: Required plug-in compatibility UUID 37B30044-3B14-46BA-ABAA-F01000C27B63 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs

Executing /Users/ct/.cedar/build/Release-iphonesimulator/iOSFrameworkSpecs.app/iOSFrameworkSpecs -RegisterForSystemEvents
2014-01-31 21:11:07.951 iOSFrameworkSpecs[48802:507] Unknown Device Type. Using UIUserInterfaceIdiomPhone based on screen size
2014-01-31 21:11:08.003 iOSFrameworkSpecs[48802:507] No workspace port detected, creating one and disabling -[UIWindow _createContext]...
2014-01-31 21:11:08.004 iOSFrameworkSpecs[48802:507] Hiding 'BKSetAccelerometerClientEventsEnabled failed: (ipc/send) invalid destination port'
2014-01-31 21:11:08.065 iOSFrameworkSpecs[48802:507] Hiding 'BKSetAccelerometerClientEventsEnabled failed: (ipc/send) invalid destination port'
Running With Random Seed: 99071

.

Finished in 0.0012 seconds

1 examples, 0 failures
Output: /Users/ct/.cedar/build/build_cedar.output
Executing xcodebuild -project Cedar.xcodeproj -target Cedar -configuration Release build SYMROOT='/Users/ct/.cedar/build'
2014-01-31 21:11:09.481 xcodebuild[48804:1007] [MT] PluginLoading: Required plug-in compatibility UUID 37B30044-3B14-46BA-ABAA-F01000C27B63 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
rake aborted!
undefined method `split' for nil:NilClass
/Users/ct/.cedar/Rakefile:295:in `block in <top (required)>'
/Users/ct/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
/Users/ct/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => upgrade
(See full trace by running task with --trace)

False-positive test pass when first describe() isn't describing a concrete class

I found that the first describe statement in a file has to have a meaningful description.

Add a failing spec to the example spec file and the tests still pass:

using namespace Cedar::Matchers;
using namespace Cedar::Doubles;

SPEC_BEGIN(ExampleSpec)

/* This is not an exhaustive list of usages.
   For more information, please visit https://github.com/pivotal/cedar */

describe(@"Example specs on NSString", ^{

    it(@"fails", ^{
        NO should be_truthy();
    });

//...
Test Suite '/Users/ct/Library/Developer/Xcode/DerivedData/CedarExperiments-dqzfzcbkznpohtepgozwrfisqpzd/Build/Products/Debug/Specs.octest(Tests)' started at 2014-01-31 17:19:37 +0000
Test Suite '/Users/ct/Library/Developer/Xcode/DerivedData/CedarExperiments-dqzfzcbkznpohtepgozwrfisqpzd/Build/Products/Debug/Specs.octest(Tests)' finished at 2014-01-31 17:19:37 +0000.
Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.005) seconds
Test Suite 'All tests' started at 2014-01-31 17:19:37 +0000
Test Suite 'Cedar.framework' started at 2014-01-31 17:19:37 +0000
Test Suite 'Example specs on NSStringSpec' started at 2014-01-31 17:19:37 +0000
Test Case '-[Example specs on NSStringSpec fails]' started.
/Users/ct/Coding/Mac/CedarExperiments/Specs/ExampleSpec.mm:12: error: -[Example specs on NSStringSpec fails] : Expected <NO> to evaluate to true
Test Case '-[Example specs on NSStringSpec fails]' failed (0.000 seconds).
Test Case '-[Example specs on NSStringSpec lowercaseString_returns_a_new_string_with_everything_in_lower_case]' started.
Test Case '-[Example specs on NSStringSpec lowercaseString_returns_a_new_string_with_everything_in_lower_case]' passed (0.000 seconds).
Test Case '-[Example specs on NSStringSpec length_returns_the_number_of_characters_in_the_string]' started.
Test Case '-[Example specs on NSStringSpec length_returns_the_number_of_characters_in_the_string]' passed (0.000 seconds).
Test Case '-[Example specs on NSStringSpec isEqualToString_should_return_true_if_the_strings_are_the_same]' started.
Test Case '-[Example specs on NSStringSpec isEqualToString_should_return_true_if_the_strings_are_the_same]' passed (0.000 seconds).
Test Case '-[Example specs on NSStringSpec isEqualToString_should_return_false_if_the_strings_are_not_the_same]' started.
Test Case '-[Example specs on NSStringSpec isEqualToString_should_return_false_if_the_strings_are_not_the_same]' passed (0.000 seconds).
Test Case '-[Example specs on NSStringSpec NSMutableString_should_be_a_kind_of_NSString]' started.
Test Case '-[Example specs on NSStringSpec NSMutableString_should_be_a_kind_of_NSString]' passed (0.000 seconds).
Test Suite 'Example specs on NSStringSpec' finished at 2014-01-31 17:19:37 +0000.
Executed 1 test, with 0 failures (0 unexpected) in 0.0000 (0.0000) seconds
Test Suite 'Cedar.framework' finished at 2014-01-31 17:19:37 +0000.
Executed 6 tests, with 1 failure (0 unexpected) in 0.0052 (0.0052) seconds
Test Suite 'All tests' finished at 2014-01-31 17:19:37 +0000.
Executed 6 tests, with 1 failure (0 unexpected) in 0.0052 (0.0052) seconds
Program ended with exit code: 1

The exit code is != 0, still the failure doesn't pop up under "Issues". Also, the bezel says "Test Succeeded".

Change one line to describe(@"NSString", ^{ // ... and the output is as expected.

<tr1/memory> file not found

With a latest cedar I followed the instructions on how to install it and create a new spec target suite. However when I build I always get this error:

[tr1/memory] file not found

I use XCode 4.5 and I tried to perform the actions on a celan new project just to make sure that my settings are not the reason.

Test suite fails because of hardcoded decimal format

This one and other 45 specs failed because of issues with decimal string representation.

FAILURE be_less_than matcher when the actual value is a built-in type and the expected value is declared as an NSDecimal and the actual value is less than the expected value negative match should fail with a sensible failure message
/tmp/cedar/Spec/Matchers/Base/BeLessThanSpec.mm:294 Expected failure message: <Expected <10> to not be less than <100.5>> but received failure message <Expected <10> to not be less than <100,5>>

The problem is that expected messages have hardcoded values with . decimal mark, which is not correct for all locales.

This issue refer only to "development mode", not to "end users usage".

Issue on Mac OS X Lion

Have you tried building and running on Lion?

I've got two different machine running Lion, and while I can build the static libs and frameworks for Cedar on both, My spec app (and the iPhoneSpecs app in the Cedar project) crash when loading:

void CDRDefineGlobalBeforeAndAfterEachBlocks() {
    [SpecHelper specHelper].globalBeforeEachClasses = CDRSelectClasses(^BOOL(Class class) { return !!class_getClassMethod(class, @selector(beforeEach)); });
    [SpecHelper specHelper].globalAfterEachClasses = CDRSelectClasses(^BOOL(Class class) { return !!class_getClassMethod(class, @selector(afterEach)); });
}

where the first line makes a call to ___CFBasicHashFindBucket_Linear

Any guidance?

Correct nil should equal(nil) checking

Case 1

nil should equal(nil)
Result : Succeeds, since nil has integer type

Case 2

obj.stringPropery = nil
obj2.stringPropery = nil
...
obj.stringPropery should equal(obj2.stringPropery)

Result : Fails, since Equal comparator
https://github.com/pivotal/cedar/blob/master/Source/Headers/Matchers/Comparators/CompareEqual.h#L9
will transform it [nil isEqual:nil]

Proposed solution

Add by-reference check for objects

return [actualValueId nonretainedObjectValue] == [expectedValueId nonretainedObjectValue] || [[actualValueId nonretainedObjectValue] isEqual:[expectedValueId nonretainedObjectValue]];

OR

return ([actualValueId nonretainedObjectValue] == nil && [expectedValueId nonretainedObjectValue] == nil) || 
       ([[actualValueId nonretainedObjectValue] isEqual:[expectedValueId nonretainedObjectValue]]);

Using spy_on on object, breaks KVO observing logic

So the problem is that

observingObject = [[[ObjectWithProperties alloc] init] autorelease];
observer = [[NoOpKeyValueObserver new] autorelease];
spy_on(observingObject);

[observingObject addObserver:observer forKeyPath:@"floatProperty" options:0 context:nil];
spy_on(observer);
observingObject.floatProperty = 12;
observer should have_received("observeValueForKeyPath:ofObject:change:context:");

Fails.

I've added some tests in my own fork.
Also, I've fixed some issues with crashes when using addObserver/removeObserver methods, but still it won't work with KVO observing on properties

PaulTaykalo@3bea5a4

Object not instantiated

Hi
I just started to setup my cedar tests and the example specs are passing.

I tried to test a very simple method but I could not get it to work:

in my test (Transaction.mm)

    describe(@"getRootApiUrl", ^{
        it(@"returns the root url", ^{
            NSString *baseUrl = [aTransaction getRootApiUrl];
            baseUrl should equal(@"hello);
        });
    });

Transaction.m

-(NSString *) getRootApiUrl
{
    NSString *rootApiUrl = @"hello";
    return rootApiUrl;
}

Transaction.h

-(NSString *) getRootApiUrl;

When runing my test I have this error:

Expected <(null)> to equal <hello>

I am not sure what I am missing.

Thanks a lot in advance for you help

Sent messages are recorded twice

Looks like same invocation is recorded twice: once by CDRFake's forwardInvocation and then by CedarDoubleImpl's invoke_stubbed_method. Current result is same invocation instance can be found in sent_messages.

Importing objc/runtime.h in CDRProtocolFake.h breaks any app with a class named "Category"

The current implementation of objc/runtime.h typedefs a struct called Category, which of course conflicts with anything else that happens to be named Category. This is only a problem because runtime.h is imported by CDRProtocolFake.h, which causes it to "infect" any project using Cedar. I don't see any need for CDRProtocolFake.h to import runtime.h, especially given the commit of Sept 1 that moved all of the implementation to a .m file.

It could be argued that naming a class Category is a bad idea, but it's not a reserved token in ObjC and should be allowable.

I'm pretty sure I had entered a similar issue some time ago for some other header that had the same problem because I remember typing something very similar to the previous paragraph, but I can't find it in the closed issues. Thanks for fixing it all the same. Can we get it fixed in CDRProtocolFake.h as well?

Is there some way to add a spec that checks that no header files are importing runtime.h?

Header incompatibilities with automatic reference counting.

Base.h contains a template function with an autorelease in it, and ActualValue.h has a release in it.

Obviously we can work around it by turning off ARC per file, but it feels a little hackish. Would love it if the headers were ARC compatible and unsure of how you want to handle it best.

Can't load an external library

Hi
I am trying to load an object in my specs and the build is failing
My object depends on some libraries but for some reason they don't get loaded and I have the following error message

  "_AVAudioSessionCategoryPlayAndRecord", referenced from:
      -[uniMag activateAudioSession] in reader.a(uniMag.o)

I am not sure what objects are supposed to be in the linker build phase for my target.

Non-Retina Asset

The icon for iOS Cedar Spec Suite target is pixelated on a Retina display.

AppCode reports introdpection error with be_instance_of

See attached image:

cedar-introspection

. . . not sure if the parameter needs to be const internally, but simply dropping it from the following:

    inline BeInstanceOf be_instance_of(const Class expectedValue) {
        return BeInstanceOf(expectedValue);
    }

. . hides the error from the user's point of view.

Xcode integration still broken

I just installed version 0.9.5 with the script and created a sample iOS App project with a Cedar Testing Bundle.

Xcode integration still seems to be broken:

  • In the Test Navigator Pane, examples are listet only after running the tests.
    When the examples finished, the status will be correctly marked, though.

  • In the Issue Navigator Pane, a failed test will have a "crippled" error message, e.g:

    -[ExampleSpec
    Unknown test failure

  • In the source file of an example, there is no indication which example or test failed.

  • When clicking on the failed test in the Issue Navigator, Xcode won't route to the corresponding source location in the example.

  • There is no diamond in the gutter beneath an example in the source file which could be clicked in order to run a focussed test.

  • In the Test Navigator Pane, clicking on an example does not start the focussed test.

The feature "focussed tests" via prepending "f" to an example does work, though.

The Version 0.9.5 changes document mentions a "diamond" in the gutter - I'm curios how to accomplish this.

I've no experience with Cedar, but if Xcode integration could be improved, I would certainly prefer it over a few others - it looks very promising.

Linker error when calling runSpecs() from a c++ file

I have changed the CDRFunctions.h to properly wrap them for C++:

import <Foundation/Foundation.h>

if __cplusplus

extern "C" {

endif

NSArray _CDRReportersFromEnv(const char_defaultReporterClassName);

int runSpecs();
int runAllSpecs() attribute((deprecated));
int runSpecsWithCustomExampleReporters(NSArray *reporters);
NSArray *specClassesToRun();

if __cplusplus

}

endif

Update documentation on build Rakefile for CocoaPod projects

I use Cocoapods as my dependency manager which involves working with a xcworkspace instead of a xcodeproj. As a matter of fact, using xcodebuild with a
-target flag fails because it can't find the lPods library. Instead, I use workspace+scheme combo

Therefore I modified the generated Rakefile to something like

xctool -workspace '#{TestName::PROJECT_ROOT}/WorkspaceName.xcworkspace' -scheme #{TestName::UI_SPECS_TARGET_NAME} .....CONFIGURATION_BUILD_DIR=#{File.join(TestName.build_dir("-iphonesimulator"))}

I don't think it's necessary to add source to handle such case as it will only add more complexity. But I think it will be useful to mention it on the documentation for all the Cocoapods users.

Undefined symbols for architecture x86_64

Set "Strip Debug Symbols During Copy" to "No" doe's not work for me.

when i try

describe(@"Person", ^{
__block Person *model;

beforeEach(^{
    model = [[Person alloc] init]; << code with issue

i have this ...

Ld /Users/romb/Library/Developer/Xcode/DerivedData/ConsoleApp01-dulryjloyqommubnkizdiuifjymu/Build/Products/Debug/Specs normal x86_64
cd /Users/romb/Documents/kBox/ConsoleApp01
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -L/Users/romb/Library/Developer/Xcode/DerivedData/ConsoleApp01-dulryjloyqommubnkizdiuifjymu/Build/Products/Debug -F/Users/romb/Library/Developer/Xcode/DerivedData/ConsoleApp01-dulryjloyqommubnkizdiuifjymu/Build/Products/Debug -F/Users/romb/Documents/kBox/ConsoleApp01/Specs/Frameworks -filelist /Users/romb/Library/Developer/Xcode/DerivedData/ConsoleApp01-dulryjloyqommubnkizdiuifjymu/Build/Intermediates/ConsoleApp01.build/Debug/Specs.build/Objects-normal/x86_64/Specs.LinkFileList -mmacosx-version-min=10.7 -fobjc-arc -fobjc-link-runtime -stdlib=libc++ -framework Foundation -framework Cedar -o /Users/romb/Library/Developer/Xcode/DerivedData/ConsoleApp01-dulryjloyqommubnkizdiuifjymu/Build/Products/Debug/Specs

Undefined symbols for architecture x86_64:
"OBJC_CLASS$_Person", referenced from:
objc-class-ref in PersonSpec.o
(maybe you meant: OBJC_CLASS$_PersonSpec)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Fix for coverage generation : call gcov_flush() afer all tests finished

It is not Cedar issue, actually, but...

Becasue Xcode 5 coverage information is broken for now ( gcda files aren't being generated).

http://stackoverflow.com/questions/19136767/generate-gcda-files-with-xcode5-ios7-simulator-and-xctest
http://stackoverflow.com/questions/18394655/xcode5-code-coverage-from-cmd-line-for-ci-builds

I assume that possibly there's an option to add gcov_flush()

There's an another option:
Add ability to run some code Before/After ALL test

should contain issue

Hello,

This expectation passes for me:

fit(@"should fail when a string is not found", ^{
[[nil someCall] lastPathComponent] should contain(@"some string");
}

This seems an error to me. Any ideas ?

Thank you

Total Rakefile build time

Hi guys, What do you think about adding total Script running time in Rakefile?

I'm asking about that because it's kind'a strange when you're waiting for compilation pre-build phases for a 2 minutes or so, and then you see 0.4 sec tests running time :)

Inconsistent bundle directory when ran from command line.

When I run the test suites in Xcode, the target is able to find the path of my persistent storage (sqlite) for Core Data. Which is in
/Users/jaychae/Library/Application Support/iPhone Simulator/6.1/Applications/C277AE37-1F31-43B4-93F9-155C87A0D199/Documents/EWS.sqlite

But when I run the test from command line using rake EWSTestSuite, this is the path I get, and throws exception for the missing sqlite file.

/var/folders/fv/vyxd6z8j7_j1r28z7b7v_jch0000gn/T/Documents/EWS.sqlite

Testing that an object is instantiated

Hi,
I would like to test this kind of method

-(void) doSome {
    foo = [[myClass alloc] init];
    [foo bar];
}

In Rspec I might do something like
myClass.should_receive(:new) { someInstance }
someInstance.should_receive(:bar)

But I cannot get the same pattern to work with cedar as I cannot stub the alloc method.

Any idea on how to solve that?

Thanks
Paul & Elie

installCodeSnippetsAndTemplates not works with XCode 4.4.1

When i try execute the install script i got this error below:

seems my XCode version (Version 4.4.1 (4F1003)) isn't compatible with installCodeSnippetsAndTemplates

$ ./installCodeSnippetsAndTemplates

===== Installing Code Snippets and Templates =====

Output: /Users/fagnermoura/Developer/ios5/cedar/build/clean.output
Executing rm -rf /Users/fagnermoura/Developer/ios5/cedar/build/*

Removing old templates...
Executing rm -rf "/Users/fagnermoura/Library/Developer/Xcode/Templates/File Templates/Cedar"
Executing rm -rf "/Users/fagnermoura/Library/Developer/Xcode/Templates/Project Templates/Cedar"
Executing grep -Rl isCedarSnippet /Users/fagnermoura/Library/Developer/Xcode/UserData/CodeSnippets | xargs -I{} rm -f "{}"
Output: /Users/fagnermoura/Developer/ios5/cedar/build/build_cedar.output
Executing xcodebuild -project Cedar.xcodeproj -target Cedar -configuration Release build SYMROOT=/Users/fagnermoura/Developer/ios5/cedar/build
sh: /Volumes/Xcode: No such file or directory
/Volumes/Xcode 1/Xcode45-DP3.app/Contents/Developer/usr/bin/xcodebuild fails with 32512 - Unknown error: 32512
rake aborted!
******** Build failed ********

Tasks: TOP => install => dist:prepare => build_frameworks
(See full trace by running task with --trace)

*** It seems something went wrong installing the code snippets and templates. Check the build output for errors. ***

XCode 5, iOS 7 Deployment target Build Failure

We're having an issue running the basic specs from the basic Pivotal tutorial found here: http://pivotallabs.com/test-driven-iphone-development-with-cedar/

Additionally, we're having the same problem in another project of ours where we're trying to upgrade our Cedar framework.

The following is the error when we run rake Specs --trace:

Ld build/Recipies.build/Release-iphonesimulator/Specs.build/Objects-normal/x86_64/Specs normal x86_64
    cd /Users/SoftwareDev/Desktop/Recipies
    setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/SoftwareDev/.rbenv/versions/1.9.3-p194/bin:/usr/local/Cellar/rbenv/0.3.0/libexec:/usr/local/heroku:/usr/local/heroku/bin:/usr/local/bin:/Users/SoftwareDev/.rbenv/shims:/Users/SoftwareDev/.rbenv/bin:/android-sdk-mac_86/platform-tools:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/SoftwareDev/Desktop/Recipies/build/Release-iphonesimulator -F/Users/SoftwareDev/Desktop/Recipies/build/Release-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Users/SoftwareDev/Desktop/Recipies/Specs/Frameworks -filelist /Users/SoftwareDev/Desktop/Recipies/build/Recipies.build/Release-iphonesimulator/Specs.build/Objects-normal/x86_64/Specs.LinkFileList -bundle_loader /Users/SoftwareDev/Desktop/Recipies/build/Release-iphonesimulator/Recipies.app/Recipies -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load -lstdc++ -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework CoreGraphics -framework UIKit -framework Cedar-iOS -framework SenTestingKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/SoftwareDev/Desktop/Recipies/build/Recipies.build/Release-iphonesimulator/Specs.build/Objects-normal/x86_64/Specs_dependency_info.dat -o /Users/SoftwareDev/Desktop/Recipies/build/Recipies.build/Release-iphonesimulator/Specs.build/Objects-normal/x86_64/Specs
ld: warning: ignoring file /Users/SoftwareDev/Desktop/Recipies/Specs/Frameworks/Cedar-iOS.framework/Cedar-iOS, missing required architecture x86_64 in file /Users/SoftwareDev/Desktop/Recipies/Specs/Frameworks/Cedar-iOS.framework/Cedar-iOS (3 slices)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_CDRSpec", referenced from:
      _OBJC_CLASS_$_ExampleSpec in ExampleSpec.o
  "_OBJC_CLASS_$_CDRSpecFailure", referenced from:
      objc-class-ref in ExampleSpec.o
  "_OBJC_METACLASS_$_CDRSpec", referenced from:
      _OBJC_METACLASS_$_ExampleSpec in ExampleSpec.o
  "Cedar::Matchers::Stringifiers::object_description_for(void const*)", referenced from:
      NSString* Cedar::Matchers::Base<Cedar::Matchers::BaseMessageBuilder>::failure_message_for<NSString* __strong>(NSString* __strong const&) const in ExampleSpec.o
      NSString* Cedar::Matchers::Base<Cedar::Matchers::BaseMessageBuilder>::negative_failure_message_for<NSString* __strong>(NSString* __strong const&) const in ExampleSpec.o
      Cedar::Matchers::Equal<NSString* __strong>::failure_message_end() const in ExampleSpec.o
  "Cedar::Matchers::RaiseException::RaiseException(NSObject*, objc_class*, bool, NSString*)", referenced from:
      __GLOBAL__I_a in ExampleSpec.o
  "Cedar::Matchers::RaiseException::~RaiseException()", referenced from:
      __GLOBAL__I_a in ExampleSpec.o
  "_describe", referenced from:
      -[ExampleSpec declareBehaviors] in ExampleSpec.o
      ___31-[ExampleSpec declareBehaviors]_block_invoke in ExampleSpec.o
  "_it", referenced from:
      ___31-[ExampleSpec declareBehaviors]_block_invoke in ExampleSpec.o
      ___31-[ExampleSpec declareBehaviors]_block_invoke_4 in ExampleSpec.o
      ___31-[ExampleSpec declareBehaviors]_block_invoke_7 in ExampleSpec.o
     (maybe you meant: __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld build/Recipies.build/Release-iphonesimulator/Specs.build/Objects-normal/x86_64/Specs normal x86_64
(1 failure)
rake aborted!
******** Build failed ********

We're not sure why it's trying to build against x86_64. x86_64 doesn't show up anywhere in our build settings in the XCode project - only armv7, armv7s, and armv64.

Please add semantic version tags

Iโ€™ve recently added Cedar to the CocoaPods package manager repo.

CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and provides a central repository for iOS/OSX libraries. This makes adding libraries to a project and updating them extremely easy and it will help users to resolve dependencies of the libraries they use.

However, Cedar doesn't have any version tags. Iโ€™ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.

Semantic version tags (instead of plain commit hashes/revisions) allow for resolution of cross-dependencies.

In case you didnโ€™t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:

$ git tag -a 1.0.0 -m "Tag release 1.0.0"
$ git push --tags

Question: Does the ARC issue effects `should`-style matchers as well?

Since the template project use should-style matchers in ExampleSpec.mm but It's not clear from the documentation wether it has the same problem with ARC like expect()-style matchers or not.

Also Expecta integration with Cedar is not as trivial as it seems so I am wondering wether I should continue using Cedar's should-style matcher (as opposed to the problematic expect() calls) or spend the time to make Expecta works properly with Cedar?

False-negative testing result (v0.9.4)

All of a sudden, Cedar and Xcode don't seem to play well together anymore.

Xcode doesn't seem to clean the target's issues. When I satisfy a test assertion, the red "Expected ..." marking doesn't go away anymore. Also, Xcodes bezel shows "Test failed" although the console output states something different:

Test Suite 'All tests' finished at 2014-02-20 14:33:13 +0000.
Executed 206 tests, with 0 failures (0 unexpected) in 0.7681 (0.7681) seconds
Program ended with exit code: 0

I always had issues with invocations of unstubbed methods or NSParameterAssert failures: they showed up in the issue navigator under the right target, but the reference file was always "null". I had to look at the error message to see where it came from. For example: file:///(null): test failure: -[CTWApplicationScoresSpec retrieving_a_score_when_theres_a_score_for_the_app_creates_a_score_with_the_application] failed: Invalid parameter not satisfying: application

I tried to undo today's work entirely to get back a working environment, but no success. Maybe I missed something Xcode related? Any ideas?

Since I can't install the stable 0.9.5 (#178), I don't know if you happen to have fixed stuff like this already.

Matcher template semantic issue

This may be a case of user error, however after setting up cedar in our iOS project and blank test projects from scratch half a dozen times I'm still here scratching my head as to why I can't get any of the matchers to work with object literals. I sent a message to the Google Group a couple weeks ago but noticed it hadn't been approved.

The issue is that if I pass in object literals like @strings or [NSNumber numberWithInt:2] to the equal or expect macros then the examples won't build. The errors usually look like this:

Semantic Issue
error: no matching function for call to 'equal' [3]

For example, here's a sample spec I set up in a blank project + cedar:

#import <Cedar-iOS/SpecHelper.h>

using namespace Cedar::Matchers;

SPEC_BEGIN(ExampleSpec)
describe(@"Example", ^{
    it(@"should compare scalars", ^{
        expect(1+1).to(equal(2));
    });

    it(@"should compare objects", ^{
        // Works fine
        NSString* aString = @"something";
        expect(aString).to(equal(aString));

        // Works fine
        NSString* bString = @"something";
        expect(aString).to(equal(bString));

        // Semantic Issue
        // error: no matching function for call to 'equal' [3]
        expect(aString).to(equal(@"something"));        

        // Semantic Issue
        // error: no matching function for call to 'equal' [3]
        NSNumber *two = [NSNumber numberWithInt:(1+1)];
        expect([NSNumber numberWithInt:(1+1)]).to(equal([NSNumber numberWithInt:(2)]));        
    });
});
SPEC_END

I've detailed the exact setup instructions I've taken along with code and screenshots in this gist: https://gist.github.com/1691576

I've tried to get the target settings to match the Cedar iPhoneSpecs target settings, but still no joy. Any ideas?

Including the following scripts in the Xcode templates allowd cmd-line builds:

I had trouble running the Rake tasks that are installed with Cedar's Xcode templates. Do these have dependencies, if so can the first task be to check these?

Here's a shell script that could potentially be included. Its added as a Run Script build phase in the test target. . . (do Xcode templates allow defining an additional build phase?)

File: _RunTests.sh_

#!/bin/sh

# If we aren't running from the command line, then exit
if [ "$TEST_CLI" = "" ]; then
  exit 0
fi

export DYLD_ROOT_PATH="$SDKROOT"
export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"
export IPHONE_SIMULATOR_ROOT="$SDKROOT"
export CFFIXED_USER_HOME="$TEMP_FILES_DIR/iPhone Simulator User Dir"

if [ -d $"CFFIXED_USER_HOME" ]; then
  rm -rf "$CFFIXED_USER_HOME"
fi
mkdir -p "$CFFIXED_USER_HOME"

export NSDebugEnabled=YES
export NSZombieEnabled=YES
export NSDeallocateZombies=NO
export NSHangOnUncaughtException=YES
export NSAutoreleaseFreedObjectCheckEnabled=YES
export CEDAR_REPORTER_CLASS=CDRColorizedReporter

export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"

TEST_TARGET_EXECUTABLE_PATH="$TARGET_BUILD_DIR/$EXECUTABLE_PATH"

if [ ! -e "$TEST_TARGET_EXECUTABLE_PATH" ]; then
  echo ""
  echo "  ------------------------------------------------------------------------"
  echo "  Missing executable path: "
  echo "     $TEST_TARGET_EXECUTABLE_PATH."
  echo "  The product may have failed to build or could have an old xcodebuild in your path (from 3.x instead of 4.x)."
  echo "  ------------------------------------------------------------------------"
  echo ""
  exit 1
fi

RUN_CMD="\"$TEST_TARGET_EXECUTABLE_PATH\" -RegisterForSystemEvents"


echo "Running: $RUN_CMD"
set +o errexit # Disable exiting on error so script continues if tests fail
eval $RUN_CMD
RETVAL=$?
set -o errexit

unset DYLD_ROOT_PATH
unset DYLD_FRAMEWORK_PATH
unset IPHONE_SIMULATOR_ROOT

exit $RETVAL

New Release Tag

I'd like to update CoacoaPods with a version of Cedar that includes the changes from #47.

Would it be possible to get HEAD tagged with a new version number?

Command Line Tests Failed, whe simulator SDK_VERSION is set to 6.0

If I change SDK_VERSION to "6.0" in RakeFile and try to run unittests with cedar, I''ll receive next result :

Unknown Device Type. Using UIUserInterfaceIdiomPhone based on screen size
Terminating since there is no workspace.

And test's won't be ran at all.

There's a simple hack how to fix it:
Add line to main.m

// Faking up workspace port
CFMessagePortCreateLocal(NULL, (CFStringRef) @"PurpleWorkspacePort", NULL, NULL,NULL);
return UIApplicationMain(argc, argv, nil, @"CedarApplicationDelegate");

And category on UIWindow

@implementation UIWindow (Private)
- (void)_createContext {
}
@end

This allows test to run with SDK 6.0

ARC compliance

I know it is in the Pivotal project but I would like to reopen issue #30 that was posted a few months ago.

For new projects it would be rather important to have ARC compliance. SInce I'm not a C++ developer I can't really help with the necessary conversion, but I would like too reopen the issue since more and more projects go to ARC compliance.

I went back to OCUnit tests for now...

spy_on an NSTimer object halts test execution due to EXC_BAD_ACCESS

I tried to use spy_on to check for method invocation of NSTimer. I thought about wrapping NSTimer in an interface just to stub it during tests and I probably will go that route. Nevertheless, I don't get why test execution fails:

describe(@"-recalibrateTimer", ^{
    __block NSTimer *oldTimer;

    beforeEach(^{
        // alarm is an object retained and notified by the timer
        oldTimer = [alarm timer];
        spy_on(oldTimer);

        [alarm recalibrateTimer];
    });

    it(@"invalidates its timer", ^{
        //oldTimer should have_received("fireDate");
    });
});

With

- (void)recalibrateTimer
{
    [self.timer fireDate]; // Just to test spying

    //NSTimer *oldTimer = self.timer;
    //[self initializeMidnightTimer];
    //[oldTimer invalidate];
}

This results in a EXC_BAD_ACCESS, code=2, in CDRSpyInfo.mm, line 50:

+ (CDRSpyInfo *)spyInfoForObject:(id)object {
    return [currentSpies__ objectsPassingTest:^BOOL(CDRSpyInfo *spyInfo, BOOL *stop) {
        if (spyInfo.originalObject == object) {
            *stop = YES;
            return YES;
        }
        return NO;
    }].anyObject;
}

Without calling a method on the object, the error doesn't occur.

The call stack (?) of the open Debug Navigator is full of triples like this:
#29 0x00007fff979635a4 in -NSInvocation invokeUsingIMP:
#30 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#31 0x00007fff978c0384 in _forwarding_ ()

The full call tree is below. Never happened to me, yet; is this a sign of sack overflow/infinite recursion?


Thread 1, Queue : com.apple.main-thread
#0  0x00007fff9062b4a7 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
#1  0x00007fff9784cd72 in _CFAutoreleasePoolPop ()
#2  0x00007fff978ba25f in __NSSetEnumerate ()
#3  0x00007fff978b9ed7 in -[NSSet objectsWithOptions:passingTest:] ()
#4  0x00000001005af955 in +[CDRSpyInfo spyInfoForObject:] at /Users/ct/.cedar/Source/Doubles/CDRSpyInfo.mm:50
#5  0x00000001005a86b0 in -[CDRSpy as_spied_class:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:183
#6  0x00000001005a8235 in -[CDRSpy methodSignatureForSelector:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:122
#7  0x00007fff978c02b2 in ___forwarding___ ()
#8  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#9  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#10 0x00007fff9784ddec in __invoking___ ()
#11 0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#12 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#13 0x00007fff978c0384 in ___forwarding___ ()
#14 0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#15 0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#16 0x00007fff9784ddec in __invoking___ ()
#17 0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#18 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#19 0x00007fff978c0384 in ___forwarding___ ()
#20 0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#21 0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#22 0x00007fff9784ddec in __invoking___ ()
#23 0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#24 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#25 0x00007fff978c0384 in ___forwarding___ ()
#26 0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#27 0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#28 0x00007fff9784ddec in __invoking___ ()
#29 0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#30 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#31 0x00007fff978c0384 in ___forwarding___ ()
#32 0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#33 0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#34 0x00007fff9784ddec in __invoking___ ()
#35 0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#36 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#37 0x00007fff978c0384 in ___forwarding___ ()
#38 0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#39 0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#40 0x00007fff9784ddec in __invoking___ ()
#41 0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#42 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#43 0x00007fff978c0384 in ___forwarding___ ()
#44 0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#45 0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#46 0x00007fff9784ddec in __invoking___ ()
#47 0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#48 0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#49 0x00007fff978c0384 in ___forwarding___ ()
#50 0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62694  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62695  0x00007fff978c0384 in ___forwarding___ ()
#62696  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62697  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62698  0x00007fff9784ddec in __invoking___ ()
#62699  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62700  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62701  0x00007fff978c0384 in ___forwarding___ ()
#62702  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62703  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62704  0x00007fff9784ddec in __invoking___ ()
#62705  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62706  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62707  0x00007fff978c0384 in ___forwarding___ ()
#62708  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62709  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62710  0x00007fff9784ddec in __invoking___ ()
#62711  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62712  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62713  0x00007fff978c0384 in ___forwarding___ ()
#62714  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62715  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62716  0x00007fff9784ddec in __invoking___ ()
#62717  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62718  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62719  0x00007fff978c0384 in ___forwarding___ ()
#62720  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62721  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62722  0x00007fff9784ddec in __invoking___ ()
#62723  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62724  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62725  0x00007fff978c0384 in ___forwarding___ ()
#62726  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62727  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62728  0x00007fff9784ddec in __invoking___ ()
#62729  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62730  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62731  0x00007fff978c0384 in ___forwarding___ ()
#62732  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62733  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62734  0x00007fff9784ddec in __invoking___ ()
#62735  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62736  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62737  0x00007fff978c0384 in ___forwarding___ ()
#62738  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62739  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62740  0x00007fff9784ddec in __invoking___ ()
#62741  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62742  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62743  0x00007fff978c0384 in ___forwarding___ ()
#62744  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62745  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62746  0x00007fff9784ddec in __invoking___ ()
#62747  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62748  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62749  0x00007fff978c0384 in ___forwarding___ ()
#62750  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62751  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62752  0x00007fff9784ddec in __invoking___ ()
#62753  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62754  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62755  0x00007fff978c0384 in ___forwarding___ ()
#62756  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62757  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62758  0x00007fff9784ddec in __invoking___ ()
#62759  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62760  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62761  0x00007fff978c0384 in ___forwarding___ ()
#62762  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62763  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62764  0x00007fff9784ddec in __invoking___ ()
#62765  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62766  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62767  0x00007fff978c0384 in ___forwarding___ ()
#62768  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62769  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62770  0x00007fff9784ddec in __invoking___ ()
#62771  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62772  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62773  0x00007fff978c0384 in ___forwarding___ ()
#62774  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62775  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62776  0x00007fff9784ddec in __invoking___ ()
#62777  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62778  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62779  0x00007fff978c0384 in ___forwarding___ ()
#62780  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62781  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62782  0x00007fff9784ddec in __invoking___ ()
#62783  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62784  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62785  0x00007fff978c0384 in ___forwarding___ ()
#62786  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62787  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62788  0x00007fff9784ddec in __invoking___ ()
#62789  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62790  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62791  0x00007fff978c0384 in ___forwarding___ ()
#62792  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62793  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62794  0x00007fff9784ddec in __invoking___ ()
#62795  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62796  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62797  0x00007fff978c0384 in ___forwarding___ ()
#62798  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62799  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62800  0x00007fff9784ddec in __invoking___ ()
#62801  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62802  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62803  0x00007fff978c0384 in ___forwarding___ ()
#62804  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62805  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62806  0x00007fff9784ddec in __invoking___ ()
#62807  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62808  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62809  0x00007fff978c0384 in ___forwarding___ ()
#62810  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62811  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62812  0x00007fff9784ddec in __invoking___ ()
#62813  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62814  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62815  0x00007fff978c0384 in ___forwarding___ ()
#62816  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62817  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62818  0x00007fff9784ddec in __invoking___ ()
#62819  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62820  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62821  0x00007fff978c0384 in ___forwarding___ ()
#62822  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62823  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62824  0x00007fff9784ddec in __invoking___ ()
#62825  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62826  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62827  0x00007fff978c0384 in ___forwarding___ ()
#62828  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62829  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62830  0x00007fff9784ddec in __invoking___ ()
#62831  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62832  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62833  0x00007fff978c0384 in ___forwarding___ ()
#62834  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62835  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62836  0x00007fff9784ddec in __invoking___ ()
#62837  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62838  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62839  0x00007fff978c0384 in ___forwarding___ ()
#62840  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62841  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62842  0x00007fff9784ddec in __invoking___ ()
#62843  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62844  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62845  0x00007fff978c0384 in ___forwarding___ ()
#62846  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62847  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62848  0x00007fff9784ddec in __invoking___ ()
#62849  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62850  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62851  0x00007fff978c0384 in ___forwarding___ ()
#62852  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62853  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62854  0x00007fff9784ddec in __invoking___ ()
#62855  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62856  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62857  0x00007fff978c0384 in ___forwarding___ ()
#62858  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62859  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62860  0x00007fff9784ddec in __invoking___ ()
#62861  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62862  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62863  0x00007fff978c0384 in ___forwarding___ ()
#62864  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62865  0x00007fff93c089bc in -[NSTimer(NSTimer) _cffireTime] ()
#62866  0x00007fff9784ddec in __invoking___ ()
#62867  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62868  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62869  0x00007fff978c0384 in ___forwarding___ ()
#62870  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62871  0x00007fff979335f2 in -[__NSCFTimer fireDate] ()
#62872  0x00007fff9784ddec in __invoking___ ()
#62873  0x00007fff979635a4 in -[NSInvocation invokeUsingIMP:] ()
#62874  0x00000001005a7ee3 in -[CDRSpy forwardInvocation:] at /Users/ct/.cedar/Source/Doubles/CDRSpy.mm:107
#62875  0x00007fff978c0384 in ___forwarding___ ()
#62876  0x00007fff978c0138 in _CF_forwarding_prep_0 ()
#62877  0x00000001004d3846 in -[CTWDailyAlarm recalibrateTimer] at /Users/ct/Coding/Mac/word-counter/WordCounter/CTWDailyAlarm.m:60
#62878  0x00000001004c01c4 in __37-[CTWDailyAlarmSpec declareBehaviors]_block_invoke_255 at /Users/ct/Coding/Mac/word-counter/Specs/CTWDailyAlarmSpec.mm:42
#62879  0x00000001005a2112 in -[CDRExampleGroup setUp] at /Users/ct/.cedar/Source/CDRExampleGroup.m:130
#62880  0x00000001005a1262 in -[CDRExample run] at /Users/ct/.cedar/Source/CDRExample.m:60
#62881  0x00007fff978a9010 in -[NSArray makeObjectsPerformSelector:] ()
#62882  0x00000001005a1ecd in -[CDRExampleGroup run] at /Users/ct/.cedar/Source/CDRExampleGroup.m:104
#62883  0x00007fff978a9010 in -[NSArray makeObjectsPerformSelector:] ()
#62884  0x00000001005a1ecd in -[CDRExampleGroup run] at /Users/ct/.cedar/Source/CDRExampleGroup.m:104
#62885  0x00007fff978a9010 in -[NSArray makeObjectsPerformSelector:] ()
#62886  0x00000001005a1ecd in -[CDRExampleGroup run] at /Users/ct/.cedar/Source/CDRExampleGroup.m:104
#62887  0x00007fff978a9010 in -[NSArray makeObjectsPerformSelector:] ()
#62888  0x00000001005a35b1 in runSpecsWithCustomExampleReporters at /Users/ct/.cedar/Source/CDRFunctions.m:209
#62889  0x00000001005a6b05 in CDRRunTests at /Users/ct/.cedar/Source/CDROTestRunner.m:20
#62890  0x0000000100001e22 in ___lldb_unnamed_function8$$otest ()
#62891  0x00000001000021a1 in ___lldb_unnamed_function10$$otest ()
#62892  0x0000000100001b46 in ___lldb_unnamed_function1$$otest ()
#62893  0x00007fff977f95fd in start ()

'CedarDoubles.h' file not found.

When using Cedar.framework in a Command Line app I'm getting a

build/Release/Cedar.framework/Headers/CDRSpec.h:38:9: fatal error: 'CedarDoubles.h' file not found
#import "CedarDoubles.h"

If I comment out the line in the CDRSpec.h, it all works and my specs run.

 xcodebuild -version                                                                                                            
Xcode 4.3
Build version 4E109

Any ideas?

iPhone Framework build script incorrectly sym links files/directories

The aggregate target "Cedar-iPhone" contains a run script that creates the embeddable framework. A part of that script creates symbolic links within the framework. The problem, however, is that those symbolic links are absolute and they need to be relative. This can cause obvious issues because the links will not change if the framework is moved.

Attached is an updated version of the build script.

You'll also need to change the copy files task to copy to Versions/Current/Headers rather the ${FRAMEWORK}/Headers.

https://gist.github.com/701862

CocoaPods installation non-obvious

In my quest to update Cedar to 0.9.5 (cf. #178), I tried to install Cedar as a project dependency using CocoaPods.

platform :osx, '10.7'
pod 'Cedar'

link_with ['Cedar095', 'specs'] # app and test target names

Installation succeeds, but building in Xcode doesn't: I get a load of linker errors. This is one of them:

  "std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
      std::__1::enable_if<__is_forward_iterator<char*>::value, void>::type std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init<char*>(char*, char*) in libPods.a(CDRProtocolFake.o)

Since you support CocoaPods, please provide instructions on how to use Cedar on a per-projekt basis using a Podfile.

be_empty should work for strings

Currently there's no matcher template for checking that an NSString* is either nil or points to an empty string. Ideally, something like this should work:

describe(@"when the pointer is nil"), ^{
    __block NSString* myString;

    before(^{
        myString = nil;
    });
    it(@"should be empty"), ^{
        myString should be_empty;
    });
});

describe(@"when the string is empty"), ^{
    __block NSString* myString;

    before(^{
        myString = @"";
    });
    it(@"should be empty"), ^{
        myString should be_empty;
    });
});

Cedar-iPhone doesn't appear in Xcode's Products group

I do not see Cedar-iPhone.framework listed in the Products group in the Xcode Navigator. So, when I build it, I don't know where to find it because normally, I'd right click on the product in the Products group and select "Show in Finder." I think I found it here: /Users/myusername/Library/Developer/Xcode/DerivedData/Cedar-somerandomlonghash/Build/Products/Debug-iphoneuniversal/Cedar-iPhone.framework

Spies should retain invocation arguments before calling through

-[UITableView endUpdates] internally calls:

<NSInvocation: 0x232d06c0>
return value: {v} void
target: {@} 0xe2b1200
selector: {:} _updateAnimationDidStop:finished:context:
argument 2: {@} 0x0
argument 3: {@} 0x456f95c
argument 4: {@} 0x232cc940

Because that method internally releases the last argument.

JUnit XML Reporting ClassName

Hi there.
I don't want to do unneeded work :)
With my last #169 JUnit XML report looks like this:

<testcase classname="Cedar" name="Full_test_name" time="0.002539"/>

It's fine.
But I was wondering about classname.

Isn't it better to put actual Class(filename) to classname attribute? And leave "Cedar" only if it's not possible to get filename?

And it will look like

<testcase classname="MySpec" name="Some test" time="0.002539"/>
<testcase classname="MyAnotherSpec" name="Yet another test" time="0.090917"/>
<testcase classname="MyAnotherSpec" name="Third one" time="0.090917"/>

It can be easily done and will provide better XML reports, grouped by files.

So the question is :
should I pull request with these changes? Or there's some additional information that is need to be done? Or it is not acceptable from removing "Cedar" :)

If there's should be note about that it was Cedar-generated report, I would suggest to put it in comments or something like that

<testcase classname="Cedar-MySpec" name="Some test" time="0.002539"/>
<testcase classname="Cedar-MyAnotherSpec" name="Yet another test" time="0.090917"/>
<testcase classname="Cedar-MyAnotherSpec" name="Third one" time="0.090917"/>

Universal Library fails to execute spec target

Undefined symbols for architecture i386:
  "std::terminate()", referenced from:
      -[CDRSpy asOriginalObject:] in Cedar-iOS(CDRSpy.o)
  "___gxx_personality_v0", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in Cedar-iOS(CDRSpy.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Commit b15ef8c5f28e985d6271bdd7b958aa1585394389 works when building and integrating the universal library.

Commit a1ae0d83da6a8f05cca34c3b2e92b1ccbd6170c7 produces a library that generates the above error message.

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.